Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(core): Avatar adopts Icon's abbreviated size scale (#4140)

Cindy Zhang5baaa93143a8
diff --git a/.changeset/avatar-size-scale.md b/.changeset/avatar-size-scale.md
new file mode 100644
index 0000000000..86c15953da
--- /dev/null
+++ b/.changeset/avatar-size-scale.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+'@astryxdesign/cli': patch
+---
+
+[breaking] Avatar and AvatarGroup adopt Icon's abbreviated size scale — `size` now takes `xsm`/`sm`/`md`/`lg`/`xl` instead of `tiny`/`xsmall`/`small`/`medium`/`large`. Pixel values are unchanged (20/24/36/48/128px) and the default is now `md` (still 36px, formerly `small`). Avatar's tiers stay larger than Icon's because avatars align with media rather than glyphs. Run `astryx upgrade` to migrate call sites. (#2672)
+@cixzhang
diff --git a/apps/docsite/src/app/(site)/_landing/hero/HeroFloatingCards.tsx b/apps/docsite/src/app/(site)/_landing/hero/HeroFloatingCards.tsx
index 79c1d9eb35..639b55fa45 100644
--- a/apps/docsite/src/app/(site)/_landing/hero/HeroFloatingCards.tsx
+++ b/apps/docsite/src/app/(site)/_landing/hero/HeroFloatingCards.tsx
@@ -493,7 +493,7 @@ export function HeroFloatingCards({
<Avatar
src={REWARD_MEMBER_AVATAR}
name={REWARD_MEMBER_NAME}
- size="xsmall"
+ size="sm"
/>
<Text type="supporting" color="secondary">
{REWARD_MEMBER_NAME}
diff --git a/apps/docsite/src/components/blog/AuthorByline.tsx b/apps/docsite/src/components/blog/AuthorByline.tsx
index 8948ccb2a7..9d5c8e89eb 100644
--- a/apps/docsite/src/components/blog/AuthorByline.tsx
+++ b/apps/docsite/src/components/blog/AuthorByline.tsx
@@ -54,7 +54,7 @@ export function AuthorByline({
className,
}: AuthorBylineProps) {
const resolved = authors.map(resolveAuthor);
- const avatarSize = variant === 'full' ? 'small' : 'tiny';
+ const avatarSize = variant === 'full' ? 'md' : 'xsm';
const textType = variant === 'full' ? 'body' : 'supporting';
// Only link author names in the full (article) byline. The compact byline
// renders inside a card-wide anchor (BlogCard), where a nested <a> would be
diff --git a/apps/example-nextjs-tailwind/src/app/page.tsx b/apps/example-nextjs-tailwind/src/app/page.tsx
index 6b5f7989ec..fef31305eb 100644
--- a/apps/example-nextjs-tailwind/src/app/page.tsx
+++ b/apps/example-nextjs-tailwind/src/app/page.tsx
@@ -232,7 +232,7 @@ export default function Home() {
<Card>
<VStack gap={3}>
<HStack gap={2} vAlign="center">
- <Avatar name="Jane Doe" size="small" />
+ <Avatar name="Jane Doe" size="md" />
<VStack gap={0}>
<Text type="label">Jane Doe</Text>
<Text type="supporting" color="secondary">
diff --git a/apps/example-vite-tailwind/src/App.tsx b/apps/example-vite-tailwind/src/App.tsx
index 23352db7cb..2432681e10 100644
--- a/apps/example-vite-tailwind/src/App.tsx
+++ b/apps/example-vite-tailwind/src/App.tsx
@@ -109,7 +109,7 @@ export default function App() {
<Card>
<VStack gap={3}>
<HStack gap={2} vAlign="center">
- <Avatar name="Alice Chen" size="small" />
+ <Avatar name="Alice Chen" size="md" />
<VStack gap={0}>
<Text type="label">Alice Chen</Text>
<Text type="supporting" color="secondary">
@@ -128,7 +128,7 @@ export default function App() {
<Card>
<VStack gap={3}>
<HStack gap={2} vAlign="center">
- <Avatar name="Bob Park" size="small" />
+ <Avatar name="Bob Park" size="md" />
<VStack gap={0}>
<Text type="label">Bob Park</Text>
<Text type="supporting" color="secondary">
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/doc-discover/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/doc-discover/page.tsx
index c21d3b20b6..b0d1280fc3 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/doc-discover/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/doc-discover/page.tsx
@@ -192,7 +192,6 @@ export default function DocDiscoverPage() {
return (
<div style={{minHeight: '100vh', backgroundColor: '#ffffff'}}>
<DocTopNav />
-
<div style={{maxWidth: 1280, margin: '0 auto', padding: '0 32px'}}>
{/* Compact header: text left, search right */}
<div
@@ -313,7 +312,7 @@ export default function DocDiscoverPage() {
{/* Footer: author + installs */}
<HStack gap={2} vAlign="center" hAlign="between">
<HStack gap={2} vAlign="center">
- <Avatar name={item.author} size="xsmall" />
+ <Avatar name={item.author} size="sm" />
<Text type="supporting" color="secondary">
{item.author}
</Text>
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/documentation/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/documentation/page.tsx
index 13f5fa9f02..d33e121358 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/documentation/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/documentation/page.tsx
@@ -691,9 +691,9 @@ export default function DocumentationPage() {
alignItems: 'center',
flexWrap: 'wrap' as const,
}}>
- <Avatar name="Alice" size="small" />
- <Avatar name="Bob" size="medium" />
- <Avatar name="Charlie" size="large" />
+ <Avatar name="Alice" size="md" />
+ <Avatar name="Bob" size="lg" />
+ <Avatar name="Charlie" size="xl" />
</div>
</div>
),
@@ -744,9 +744,7 @@ export default function DocumentationPage() {
<div
style={{display: 'flex', flexDirection: 'column' as const, gap: 12}}>
<Banner status="info" title="Information">
- <Text type="body">
- This is an informational banner message.
- </Text>
+ <Text type="body">This is an informational banner message.</Text>
</Banner>
<Banner status="success" title="Success">
<Text type="body">Operation completed successfully.</Text>
@@ -925,7 +923,6 @@ export default function DocumentationPage() {
))}
</nav>
</aside>
-
{/* MAIN CONTENT */}
<main
style={{
@@ -960,8 +957,8 @@ export default function DocumentationPage() {
<div style={{marginTop: 16}}>
<Text type="large" color="secondary">
Astryx Web React is an open-source UI library created by the
- Astryx Design Team to help developers quickly build beautiful,
- accessible products.
+ Astryx Design Team to help developers quickly build
+ beautiful, accessible products.
</Text>
</div>
<div style={{marginTop: 24}}>
@@ -978,7 +975,6 @@ export default function DocumentationPage() {
</div>
<div style={{flex: 1}} />
</div>
-
{/* Category sections */}
{COMPONENT_CATEGORIES.map(category => (
<div key={category.label} style={{marginBottom: 64}}>
@@ -1032,7 +1028,6 @@ export default function DocumentationPage() {
March 30, 2026 · Updated 5:40 p.m. PST
</Text>
</div>
-
{/* Live Preview Card */}
<div
style={{
@@ -1105,7 +1100,6 @@ export default function DocumentationPage() {
)}
</div>
</div>
-
{/* Description */}
{(() => {
const docs = getComponentDocs(activeNav);
@@ -1138,7 +1132,6 @@ export default function DocumentationPage() {
</div>
);
})()}
-
{/* Anatomy */}
{(() => {
const docs = getComponentDocs(activeNav);
diff --git a/apps/sandbox/src/app/(fullscreen)/pages/example-cards/page.tsx b/apps/sandbox/src/app/(fullscreen)/pages/example-cards/page.tsx
index 725a031c2b..4903554942 100644
--- a/apps/sandbox/src/app/(fullscreen)/pages/example-cards/page.tsx
+++ b/apps/sandbox/src/app/(fullscreen)/pages/example-cards/page.tsx
@@ -620,7 +620,7 @@ export default function ExampleCardsPage() {
<div key={i}>
<div {...stylex.props(styles.row)}>
<HStack gap={3} vAlign="center">
- <Avatar name={txn.initials} size="small" />
+ <Avatar name={txn.initials} size="md" />
<VStack gap={0}>
<Text type="body" weight="bold">
{txn.name}
@@ -1339,7 +1339,7 @@ export default function ExampleCardsPage() {
<div key={i}>
<div {...stylex.props(styles.row)}>
<HStack gap={3} vAlign="center">
- <Avatar name={s.ticker} size="small" />
+ <Avatar name={s.ticker} size="md" />
<VStack gap={0}>
<Text type="body" weight="bold">
{s.name}
diff --git a/apps/sandbox/src/app/(sandbox)/pages/table-overview/page.tsx b/apps/sandbox/src/app/(sandbox)/pages/table-overview/page.tsx
index 6fb5d936ff..7bf67218b0 100644
--- a/apps/sandbox/src/app/(sandbox)/pages/table-overview/page.tsx
+++ b/apps/sandbox/src/app/(sandbox)/pages/table-overview/page.tsx
@@ -236,11 +236,7 @@ const columns: TableColumn<ReviewRow>[] = [
width: proportional(4),
renderCell: (item: ReviewRow) => (
<HStack gap={3} vAlign="center">
- <Avatar
- src={item.authorAvatar}
- name={item.authorName}
- size="small"
- />
+ <Avatar src={item.authorAvatar} name={item.authorName} size="md" />
<div {...stylex.props(styles.authorInfo)}>
<VStack gap={1}>
<span {...stylex.props(styles.titleLink)}>{item.title}</span>
@@ -268,7 +264,7 @@ const columns: TableColumn<ReviewRow>[] = [
marginLeft: i > 0 ? -8 : 0,
zIndex: item.reviewerAvatars.length - i,
}}>
- <Avatar src={src} name={`Reviewer ${i + 1}`} size="xsmall" />
+ <Avatar src={src} name={`Reviewer ${i + 1}`} size="sm" />
</div>
))}
</div>
@@ -458,8 +454,8 @@ export default function TableOverviewPage() {
<VStack gap={2}>
<Heading level={1}>Table Overview</Heading>
<Text type="body" color="secondary">
- A code review dashboard demonstrating Table with selection,
- badges, avatars, and collapsible sections.
+ A code review dashboard demonstrating Table with selection, badges,
+ avatars, and collapsible sections.
</Text>
</VStack>
diff --git a/apps/storybook/stories/Avatar.stories.tsx b/apps/storybook/stories/Avatar.stories.tsx
index eb6c9628ff..2c4768ef28 100644
--- a/apps/storybook/stories/Avatar.stories.tsx
+++ b/apps/storybook/stories/Avatar.stories.tsx
@@ -4,7 +4,10 @@ import type {Meta, StoryObj} from '@storybook/react';
import * as stylex from '@stylexjs/stylex';
import {Avatar} from '@astryxdesign/core/Avatar';
import {AvatarStatusDot} from '@astryxdesign/core/Avatar';
-import {spacingVars, typographyVars} from '@astryxdesign/core/theme/tokens.stylex';
+import {
+ spacingVars,
+ typographyVars,
+} from '@astryxdesign/core/theme/tokens.stylex';
import {CheckIcon} from '@heroicons/react/24/solid';
const styles = stylex.create({
@@ -32,11 +35,11 @@ const meta: Meta<typeof Avatar> = {
size: {
control: 'select',
options: [
- 'tiny',
- 'xsmall',
- 'small',
- 'medium',
- 'large',
+ 'xsm',
+ 'sm',
+ 'md',
+ 'lg',
+ 'xl',
16,
20,
24,
@@ -87,7 +90,7 @@ type Story = StoryObj<typeof Avatar>;
export const Default: Story = {
args: {
name: 'John Doe',
- size: 'medium',
+ size: 'lg',
},
};
@@ -95,7 +98,7 @@ export const WithImage: Story = {
args: {
src: 'https://i.pravatar.cc/150?img=1',
name: 'Jane Smith',
- size: 'medium',
+ size: 'lg',
},
};
@@ -104,11 +107,11 @@ export const AllSizes: Story = {
<div {...stylex.props(styles.storyWrapper)}>
<h4 {...stylex.props(styles.heading)}>Named Sizes</h4>
<div {...stylex.props(styles.row)}>
- <Avatar name="TY" size="tiny" />
- <Avatar name="XS" size="xsmall" />
- <Avatar name="SM" size="small" />
- <Avatar name="MD" size="medium" />
- <Avatar name="LG" size="large" />
+ <Avatar name="TY" size="xsm" />
+ <Avatar name="XS" size="sm" />
+ <Avatar name="SM" size="md" />
+ <Avatar name="MD" size="lg" />
+ <Avatar name="LG" size="xl" />
</div>
</div>
),
@@ -122,28 +125,12 @@ export const WithImages: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=1"
name="User 1"
- size="tiny"
- />
- <Avatar
- src="https://i.pravatar.cc/150?img=2"
- name="User 2"
- size="xsmall"
- />
- <Avatar
- src="https://i.pravatar.cc/150?img=3"
- name="User 3"
- size="small"
- />
- <Avatar
- src="https://i.pravatar.cc/150?img=4"
- name="User 4"
- size="medium"
- />
- <Avatar
- src="https://i.pravatar.cc/150?img=5"
- name="User 5"
- size="large"
+ size="xsm"
/>
+ <Avatar src="https://i.pravatar.cc/150?img=2" name="User 2" size="sm" />
+ <Avatar src="https://i.pravatar.cc/150?img=3" name="User 3" size="md" />
+ <Avatar src="https://i.pravatar.cc/150?img=4" name="User 4" size="lg" />
+ <Avatar src="https://i.pravatar.cc/150?img=5" name="User 5" size="xl" />
</div>
</div>
),
@@ -154,10 +141,10 @@ export const InitialsFallback: Story = {
<div {...stylex.props(styles.storyWrapper)}>
<h4 {...stylex.props(styles.heading)}>Initials Fallback</h4>
<div {...stylex.props(styles.row)}>
- <Avatar name="John Doe" size="medium" />
- <Avatar name="Alice" size="medium" />
- <Avatar name="Bob Smith Johnson" size="medium" />
- <Avatar name="Dr. Sarah Connor" size="medium" />
+ <Avatar name="John Doe" size="lg" />
+ <Avatar name="Alice" size="lg" />
+ <Avatar name="Bob Smith Johnson" size="lg" />
+ <Avatar name="Dr. Sarah Connor" size="lg" />
</div>
</div>
),
@@ -168,11 +155,11 @@ export const NoImageNoName: Story = {
<div {...stylex.props(styles.storyWrapper)}>
<h4 {...stylex.props(styles.heading)}>Default Icon (No Image or Name)</h4>
<div {...stylex.props(styles.row)}>
- <Avatar size="tiny" />
- <Avatar size="xsmall" />
- <Avatar size="small" />
- <Avatar size="medium" />
- <Avatar size="large" />
+ <Avatar size="xsm" />
+ <Avatar size="sm" />
+ <Avatar size="md" />
+ <Avatar size="lg" />
+ <Avatar size="xl" />
</div>
</div>
),
@@ -188,7 +175,7 @@ export const FallbackChain: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=10"
name="Test User"
- size="large"
+ size="xl"
/>
</div>
<div>
@@ -199,7 +186,7 @@ export const FallbackChain: Story = {
src="https://invalid-url.example/broken.jpg"
fallbackSrc="https://i.pravatar.cc/150?img=11"
name="Test User"
- size="large"
+ size="xl"
/>
</div>
<div>
@@ -208,15 +195,12 @@ export const FallbackChain: Story = {
src="https://invalid-url.example/broken.jpg"
fallbackSrc="https://also-invalid.example/broken.jpg"
name="Test User"
- size="large"
+ size="xl"
/>
</div>
<div>
<p {...stylex.props(styles.heading)}>All invalid, no name</p>
- <Avatar
- src="https://invalid-url.example/broken.jpg"
- size="large"
- />
+ <Avatar src="https://invalid-url.example/broken.jpg" size="xl" />
</div>
</div>
</div>
@@ -231,19 +215,19 @@ export const WithStatus: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=20"
name="Online User"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
<Avatar
src="https://i.pravatar.cc/150?img=21"
name="Offline User"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="neutral" label="Offline" />}
/>
<Avatar
src="https://i.pravatar.cc/150?img=22"
name="Busy User"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="error" label="Busy" />}
/>
</div>
@@ -263,27 +247,27 @@ export const StatusAcrossAllSizes: Story = {
<div {...stylex.props(styles.row)}>
<Avatar
name="TY"
- size="tiny"
+ size="xsm"
status={<AvatarStatusDot variant="success" />}
/>
<Avatar
name="XS"
- size="xsmall"
+ size="sm"
status={<AvatarStatusDot variant="success" />}
/>
<Avatar
name="SM"
- size="small"
+ size="md"
status={<AvatarStatusDot variant="success" />}
/>
<Avatar
name="MD"
- size="medium"
+ size="lg"
status={<AvatarStatusDot variant="success" />}
/>
<Avatar
name="LG"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="success" />}
/>
</div>
@@ -333,19 +317,19 @@ export const StatusAcrossAllSizes: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=40"
name="Positive"
- size="medium"
+ size="lg"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
<Avatar
src="https://i.pravatar.cc/150?img=41"
name="Neutral"
- size="medium"
+ size="lg"
status={<AvatarStatusDot variant="neutral" label="Offline" />}
/>
<Avatar
src="https://i.pravatar.cc/150?img=42"
name="Negative"
- size="medium"
+ size="lg"
status={<AvatarStatusDot variant="error" label="Busy" />}
/>
</div>
@@ -358,9 +342,9 @@ export const StatusWithSizes: Story = {
<div {...stylex.props(styles.storyWrapper)}>
<h4 {...stylex.props(styles.heading)}>Status with Different Sizes</h4>
<div {...stylex.props(styles.row)}>
- <Avatar name="AB" size="small" status={<AvatarStatusDot />} />
- <Avatar name="CD" size="medium" status={<AvatarStatusDot />} />
- <Avatar name="EF" size="large" status={<AvatarStatusDot />} />
+ <Avatar name="AB" size="md" status={<AvatarStatusDot />} />
+ <Avatar name="CD" size="lg" status={<AvatarStatusDot />} />
+ <Avatar name="EF" size="xl" status={<AvatarStatusDot />} />
<Avatar name="GH" size={72} status={<AvatarStatusDot />} />
</div>
</div>
@@ -379,7 +363,7 @@ export const StatusWithIcon: Story = {
<div {...stylex.props(styles.row)}>
<Avatar
name="TY"
- size="tiny"
+ size="xsm"
status={
<AvatarStatusDot
variant="success"
@@ -390,7 +374,7 @@ export const StatusWithIcon: Story = {
/>
<Avatar
name="XS"
- size="xsmall"
+ size="sm"
status={
<AvatarStatusDot
variant="success"
@@ -401,7 +385,7 @@ export const StatusWithIcon: Story = {
/>
<Avatar
name="SM"
- size="small"
+ size="md"
status={
<AvatarStatusDot
variant="success"
@@ -413,7 +397,7 @@ export const StatusWithIcon: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=50"
name="MD"
- size="medium"
+ size="lg"
status={
<AvatarStatusDot
variant="success"
@@ -425,7 +409,7 @@ export const StatusWithIcon: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=51"
name="LG"
- size="large"
+ size="xl"
status={
<AvatarStatusDot
variant="success"
@@ -517,7 +501,7 @@ export const StatusWithIcon: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=52"
name="Positive"
- size="large"
+ size="xl"
status={
<AvatarStatusDot
variant="success"
@@ -529,7 +513,7 @@ export const StatusWithIcon: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=53"
name="Neutral"
- size="large"
+ size="xl"
status={
<AvatarStatusDot
variant="neutral"
@@ -541,7 +525,7 @@ export const StatusWithIcon: Story = {
<Avatar
src="https://i.pravatar.cc/150?img=54"
name="Negative"
- size="large"
+ size="xl"
status={
<AvatarStatusDot
variant="error"
diff --git a/apps/storybook/stories/AvatarGroup.stories.tsx b/apps/storybook/stories/AvatarGroup.stories.tsx
index 999aa1f930..93f3efca10 100644
--- a/apps/storybook/stories/AvatarGroup.stories.tsx
+++ b/apps/storybook/stories/AvatarGroup.stories.tsx
@@ -4,7 +4,10 @@ import * as stylex from '@stylexjs/stylex';
import {AvatarGroup, AvatarGroupOverflow} from '@astryxdesign/core/AvatarGroup';
import {Avatar} from '@astryxdesign/core/Avatar';
import {StatusDot} from '@astryxdesign/core/StatusDot';
-import {spacingVars, typographyVars} from '@astryxdesign/core/theme/tokens.stylex';
+import {
+ spacingVars,
+ typographyVars,
+} from '@astryxdesign/core/theme/tokens.stylex';
const USERS = [
{name: 'Alice Johnson', src: 'https://i.pravatar.cc/150?img=1', key: 'alice'},
@@ -37,7 +40,7 @@ const meta: Meta<typeof AvatarGroup> = {
argTypes: {
size: {
control: 'select',
- options: ['tiny', 'xsmall', 'small', 'medium', 'large'],
+ options: ['xsm', 'sm', 'md', 'lg', 'xl'],
description: 'Size applied to all child avatars',
},
},
@@ -49,7 +52,7 @@ type Story = StoryObj<typeof AvatarGroup>;
/** Basic avatar group showing all members. */
export const Default: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -60,7 +63,7 @@ export const Default: Story = {
/** Sliced to 3 with "+N" overflow indicator. */
export const WithOverflow: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -72,7 +75,7 @@ export const WithOverflow: Story = {
/** Clickable overflow indicator. */
export const ClickableOverflow: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -87,7 +90,7 @@ export const ClickableOverflow: Story = {
/** Server-side total count (47 participants, only 3 rendered). */
export const ServerSideCount: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -99,7 +102,7 @@ export const ServerSideCount: Story = {
/** Per-avatar status dots — just works with compositional API. */
export const WithStatusDots: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
<Avatar
src="https://i.pravatar.cc/150?img=1"
name="Alice"
@@ -123,7 +126,7 @@ export const WithStatusDots: Story = {
export const AllSizes: Story = {
render: () => (
<div {...stylex.props(storyStyles.storyWrapper)}>
- {(['tiny', 'xsmall', 'small', 'medium', 'large'] as const).map(size => (
+ {(['xsm', 'sm', 'md', 'lg', 'xl'] as const).map(size => (
<div key={size}>
<h4 {...stylex.props(storyStyles.heading)}>{size}</h4>
<AvatarGroup size={size}>
@@ -141,7 +144,7 @@ export const AllSizes: Story = {
/** Initials fallback when no images provided. */
export const InitialsFallback: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 4).map(u => (
<Avatar key={u.key} name={u.name} />
))}
@@ -153,7 +156,7 @@ export const InitialsFallback: Story = {
/** Single avatar — no overlap applied. */
export const SingleAvatar: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
<Avatar src="https://i.pravatar.cc/150?img=1" name="Alice Johnson" />
</AvatarGroup>
),
@@ -162,7 +165,7 @@ export const SingleAvatar: Story = {
/** Large overflow count (99+). */
export const LargeOverflowCount: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -174,7 +177,7 @@ export const LargeOverflowCount: Story = {
/** Zero overflow count edge case. */
export const ZeroOverflow: Story = {
render: () => (
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -187,7 +190,7 @@ export const ZeroOverflow: Story = {
export const NarrowContainer: Story = {
render: () => (
<div style={{width: 120, border: '1px dashed grey', padding: 8}}>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 5).map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
@@ -206,7 +209,7 @@ export const ManyAvatars: Story = {
src: `https://i.pravatar.cc/150?img=${(i % 70) + 1}`,
}));
return (
- <AvatarGroup size="small">
+ <AvatarGroup size="md">
{manyUsers.map(u => (
<Avatar key={u.key} src={u.src} name={u.name} />
))}
diff --git a/apps/storybook/stories/Chat.stories.tsx b/apps/storybook/stories/Chat.stories.tsx
index dc1539f67a..0251933495 100644
--- a/apps/storybook/stories/Chat.stories.tsx
+++ b/apps/storybook/stories/Chat.stories.tsx
@@ -54,9 +54,7 @@ For **server state**, use a library like **TanStack Query** or **SWR** — they
Avoid global state managers unless you have a genuine need for cross-cutting state. Most apps are over-engineered in this area.`}</Markdown>
<ChatMessageMetadata
- timestamp={
- <Timestamp value="2026-03-15T14:30:30" format="time" />
- }
+ timestamp={<Timestamp value="2026-03-15T14:30:30" format="time" />}
footer={
<>
<span>Claude Opus 4.6</span>
@@ -130,9 +128,7 @@ const [state, dispatch] = useReducer(reducer, initialState);`}
| \`useSyncExternalStore\` | External stores | On snapshot change | High | Redux, Zustand, signals |
| \`useRef\` | Mutable values | Never | Low | DOM refs, timers, previous values |`}</Markdown>
<ChatMessageMetadata
- timestamp={
- <Timestamp value="2026-03-15T14:31:30" format="time" />
- }
+ timestamp={<Timestamp value="2026-03-15T14:31:30" format="time" />}
footer={
<>
<span>Claude Opus 4.6</span>
@@ -254,7 +250,7 @@ export const ChatConversation: StoryObj = {
<ChatSystemMessage variant="divider">Today</ChatSystemMessage>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Navi" size="small" />}>
+ avatar={<Avatar name="Navi" size="md" />}>
<ChatMessageBubble
name={<span style={nameStyle}>Navi</span>}
metadata={
@@ -269,9 +265,7 @@ export const ChatConversation: StoryObj = {
</ChatMessageBubble>
</ChatMessage>
- <ChatMessage
- sender="user"
- avatar={<Avatar name="Cindy" size="small" />}>
+ <ChatMessage sender="user" avatar={<Avatar name="Cindy" size="md" />}>
<ChatMessageBubble
group="first"
name={<span style={nameStyle}>Cindy</span>}>
@@ -293,7 +287,7 @@ export const ChatConversation: StoryObj = {
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Navi" size="small" />}>
+ avatar={<Avatar name="Navi" size="md" />}>
<ChatMessageBubble
name={<span style={nameStyle}>Navi</span>}
metadata={
@@ -308,9 +302,7 @@ export const ChatConversation: StoryObj = {
</ChatMessageBubble>
</ChatMessage>
- <ChatMessage
- sender="user"
- avatar={<Avatar name="Cindy" size="small" />}>
+ <ChatMessage sender="user" avatar={<Avatar name="Cindy" size="md" />}>
<ChatMessageBubble
name={<span style={nameStyle}>Cindy</span>}
metadata={
@@ -336,9 +328,9 @@ export const DensityComparison: StoryObj = {
name: 'Density Comparison',
render: () => {
const avatarSize = {
- compact: 'xsmall' as const,
- balanced: 'small' as const,
- spacious: 'small' as const,
+ compact: 'sm' as const,
+ balanced: 'md' as const,
+ spacious: 'md' as const,
};
const messages = (density: 'compact' | 'balanced' | 'spacious') => (
<div
@@ -425,8 +417,7 @@ export const GapOverride: StoryObj = {
</ChatMessageBubble>
</ChatMessage>
<ChatMessage sender="assistant">
- <ChatMessageBubble
- metadata={<ChatMessageMetadata footer="Done" />}>
+ <ChatMessageBubble metadata={<ChatMessageMetadata footer="Done" />}>
The patch is ready for review.
</ChatMessageBubble>
</ChatMessage>
@@ -439,12 +430,10 @@ export const SystemMessages: StoryObj = {
render: () => (
<div style={{height: 400, display: 'flex', flexDirection: 'column'}}>
<ChatMessageList>
- <ChatSystemMessage variant="divider">
- March 15, 2026
- </ChatSystemMessage>
+ <ChatSystemMessage variant="divider">March 15, 2026</ChatSystemMessage>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Navi" size="small" />}>
+ avatar={<Avatar name="Navi" size="md" />}>
<Markdown density="compact">Good morning!</Markdown>
</ChatMessage>
<ChatSystemMessage>Conversation started</ChatSystemMessage>
@@ -469,8 +458,7 @@ export const MessageStatus: StoryObj = {
</ChatMessageBubble>
</ChatMessage>
<ChatMessage sender="user">
- <ChatMessageBubble
- metadata={<ChatMessageMetadata status="sent" />}>
+ <ChatMessageBubble metadata={<ChatMessageMetadata status="sent" />}>
Sent
</ChatMessageBubble>
</ChatMessage>
@@ -481,14 +469,12 @@ export const MessageStatus: StoryObj = {
</ChatMessageBubble>
</ChatMessage>
<ChatMessage sender="user">
- <ChatMessageBubble
- metadata={<ChatMessageMetadata status="read" />}>
+ <ChatMessageBubble metadata={<ChatMessageMetadata status="read" />}>
Read
</ChatMessageBubble>
</ChatMessage>
<ChatMessage sender="user">
- <ChatMessageBubble
- metadata={<ChatMessageMetadata status="error" />}>
+ <ChatMessageBubble metadata={<ChatMessageMetadata status="error" />}>
Failed to send
</ChatMessageBubble>
</ChatMessage>
@@ -523,7 +509,7 @@ export const MultiBubble: StoryObj = {
</ChatMessage>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Navi" size="small" />}>
+ avatar={<Avatar name="Navi" size="md" />}>
<ChatMessageBubble group="first">
Sure, looking at it now!
</ChatMessageBubble>
diff --git a/apps/storybook/stories/ChatReasoning.stories.tsx b/apps/storybook/stories/ChatReasoning.stories.tsx
index d57f62878e..d82e8b8474 100644
--- a/apps/storybook/stories/ChatReasoning.stories.tsx
+++ b/apps/storybook/stories/ChatReasoning.stories.tsx
@@ -94,9 +94,7 @@ export const InMessage: StoryObj = {
How many valid planting arrangements are possible over 3 years?
</ChatMessageBubble>
</ChatMessage>
- <ChatMessage
- sender="assistant"
- avatar={<Avatar name="AI" size="small" />}>
+ <ChatMessage sender="assistant" avatar={<Avatar name="AI" size="md" />}>
<ChatReasoning duration="12s">
Let me work through the constraints systematically...
</ChatReasoning>
diff --git a/packages/cli/src/codemods/__tests__/registry.test.mjs b/packages/cli/src/codemods/__tests__/registry.test.mjs
index 9cc2450edc..c6f7f0fad3 100644
--- a/packages/cli/src/codemods/__tests__/registry.test.mjs
+++ b/packages/cli/src/codemods/__tests__/registry.test.mjs
@@ -21,6 +21,7 @@ describe('registry', () => {
'0.1.3',
'0.1.5',
'0.1.7',
+ '0.1.8',
]);
});
});
diff --git a/packages/cli/src/codemods/registry.mjs b/packages/cli/src/codemods/registry.mjs
index 48d7d90f2c..3d0c05ffbf 100644
--- a/packages/cli/src/codemods/registry.mjs
+++ b/packages/cli/src/codemods/registry.mjs
@@ -22,6 +22,7 @@ const registry = new Map([
['0.1.3', () => import('./transforms/v0.1.3/index.mjs')],
['0.1.5', () => import('./transforms/v0.1.5/index.mjs')],
['0.1.7', () => import('./transforms/v0.1.7/index.mjs')],
+ ['0.1.8', () => import('./transforms/v0.1.8/index.mjs')],
]);
// Re-export from the shared utility so registry callers and other consumers
diff --git a/packages/cli/src/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs b/packages/cli/src/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs
new file mode 100644
index 0000000000..fd21774650
--- /dev/null
+++ b/packages/cli/src/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs
@@ -0,0 +1,161 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+import {describe, it, expect} from 'vitest';
+
+async function applyTransform(source) {
+ const {default: transform} = await import('../rename-avatar-size-scale.mjs');
+ const jscodeshift = (await import('jscodeshift')).default;
+ const j = jscodeshift.withParser('tsx');
+ const api = {jscodeshift: j, stats: () => {}, report: () => {}};
+ const file = {source, path: 'test.tsx'};
+ const result = transform(file, api);
+ return result ?? source;
+}
+
+describe('rename-avatar-size-scale', () => {
+ it('renames every named size on an Avatar JSX size attribute', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+const a = <Avatar name="A" size="tiny" />;
+const b = <Avatar name="B" size="xsmall" />;
+const c = <Avatar name="C" size="small" />;
+const d = <Avatar name="D" size="medium" />;
+const e = <Avatar name="E" size="large" />;`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`size='xsm'`);
+ expect(output).toContain(`size='sm'`);
+ expect(output).toContain(`size='md'`);
+ expect(output).toContain(`size='lg'`);
+ expect(output).toContain(`size='xl'`);
+ for (const old of ['tiny', 'xsmall', 'small', 'medium', 'large']) {
+ expect(output).not.toContain(`size="${old}"`);
+ }
+ });
+
+ it('renames size on AvatarGroup', async () => {
+ const input = `import {AvatarGroup} from '@astryxdesign/core';
+const x = <AvatarGroup size="medium">{kids}</AvatarGroup>;`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`size='lg'`);
+ });
+
+ it('leaves numeric sizes untouched', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+const x = <Avatar name="A" size={48} />;`;
+ const output = await applyTransform(input);
+ expect(output).toContain('size={48}');
+ });
+
+ it('is alias-aware', async () => {
+ const input = `import {Avatar as Face} from '@astryxdesign/core';
+const x = <Face name="A" size="small" />;`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`size='md'`);
+ });
+
+ it('renames the subpath and legacy import sources', async () => {
+ const sub = `import {Avatar} from '@astryxdesign/core/Avatar';
+const x = <Avatar name="A" size="large" />;`;
+ expect(await applyTransform(sub)).toContain(`size='xl'`);
+ const legacy = `import {Avatar} from '@xds/core';
+const x = <Avatar name="A" size="tiny" />;`;
+ expect(await applyTransform(legacy)).toContain(`size='xsm'`);
+ });
+
+ it('renames a size inside a ternary on an Avatar element', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+const x = <Avatar name="A" size={big ? 'large' : 'small'} />;`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`big ? 'xl' : 'md'`);
+ });
+
+ it('renames the UNIQUE names tiny/xsmall in Storybook options and size args', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+const meta = {
+ argTypes: {size: {control: 'select', options: ['tiny', 'xsmall']}},
+ args: {size: 'tiny'},
+};`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`['xsm', 'sm']`);
+ expect(output).toContain(`size: 'xsm'`);
+ });
+
+ it('renames a FULL Storybook options array (unique name unlocks ambiguous members)', async () => {
+ // The presence of a unique name (tiny/xsmall) proves the whole array is the
+ // Avatar size enum, so small/medium/large in it are safe to rename too.
+ const input = `import {Avatar} from '@astryxdesign/core';
+const meta = {
+ argTypes: {size: {control: 'select', options: ['tiny', 'xsmall', 'small', 'medium', 'large']}},
+};`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`['xsm', 'sm', 'md', 'lg', 'xl']`);
+ });
+
+ it('renames a standalone Avatar-size array literal used with .map()', async () => {
+ const input = `import {AvatarGroup} from '@astryxdesign/core';
+const sizes = (['tiny', 'xsmall', 'small', 'medium', 'large'] as const).map(s => s);`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`['xsm', 'sm', 'md', 'lg', 'xl']`);
+ });
+
+ it('does NOT rename an array of ambiguous words with no unique Avatar name', async () => {
+ // Without tiny/xsmall, the array could be anything (priorities, densities),
+ // so ambiguous members are left untouched.
+ const input = `import {Avatar} from '@astryxdesign/core';
+const densities = ['small', 'medium', 'large'] as const;`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`['small', 'medium', 'large']`);
+ });
+
+ it('renames a UNIQUE name in a size-typed union literal', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+type Props = {size: 'tiny' | 'xsmall'};`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`'xsm' | 'sm'`);
+ });
+
+ // --- Precision guards: ambiguous common words must NOT be corrupted in
+ // --- context-blind positions, even in files that import Avatar. ---
+
+ it('does NOT rename ambiguous names in an unrelated union type', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+type TaskPriority = 'urgent' | 'high' | 'medium' | 'low' | 'none';`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`'medium'`);
+ expect(output).not.toContain(`'lg'`);
+ });
+
+ it('does NOT rename an ambiguous name in a non-size object property', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+const cfg = {priority: 'medium', density: 'large'};`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`priority: 'medium'`);
+ expect(output).toContain(`density: 'large'`);
+ });
+
+ it('does NOT rename an ambiguous name in a size-keyed object property (component unknown)', async () => {
+ // A `size: 'small'` object entry could belong to any component; renaming it
+ // blind would be unsafe, so it is left for manual migration.
+ const input = `import {Avatar} from '@astryxdesign/core';
+const args = {size: 'small'};`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`size: 'small'`);
+ });
+
+ it('does not touch files that never import Avatar/AvatarGroup', async () => {
+ const input = `import {Badge} from '@astryxdesign/core';
+const x = <Badge size="small" />;
+type P = 'tiny' | 'xsmall';`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`size="small"`);
+ expect(output).toContain(`'tiny' | 'xsmall'`);
+ });
+
+ it('does not rename an unrelated non-size string in an Avatar file', async () => {
+ const input = `import {Avatar} from '@astryxdesign/core';
+const label = 'small';
+const x = <Avatar name="A" size="small" />;`;
+ const output = await applyTransform(input);
+ expect(output).toContain(`const label = 'small'`);
+ expect(output).toContain(`size='md'`);
+ });
+});
diff --git a/packages/cli/src/codemods/transforms/v0.1.8/index.mjs b/packages/cli/src/codemods/transforms/v0.1.8/index.mjs
new file mode 100644
index 0000000000..6ffb3aa34d
--- /dev/null
+++ b/packages/cli/src/codemods/transforms/v0.1.8/index.mjs
@@ -0,0 +1,19 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file v0.1.8 transform manifest
+ *
+ * Lists all codemods for the v0.1.8 release in the order they should run.
+ */
+
+import renameAvatarSizeScale, {
+ meta as renameAvatarSizeScaleMeta,
+} from './rename-avatar-size-scale.mjs';
+
+export default [
+ {
+ name: 'rename-avatar-size-scale',
+ transform: renameAvatarSizeScale,
+ meta: renameAvatarSizeScaleMeta,
+ },
+];
diff --git a/packages/cli/src/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs b/packages/cli/src/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs
new file mode 100644
index 0000000000..29e4e4935f
--- /dev/null
+++ b/packages/cli/src/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs
@@ -0,0 +1,234 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file Codemod: Rename Avatar named sizes to Icon's abbreviated scale
+ * @see https://github.com/facebook/astryx/issues/2672
+ *
+ * As of v0.1.8, Avatar and AvatarGroup use the same abbreviated size scale as
+ * Icon (`xsm`/`sm`/`md`/`lg`/`xl`) instead of full words. Pixel values are
+ * unchanged — only the names move:
+ *
+ * tiny (20px) → xsm
+ * xsmall (24px) → sm
+ * small (36px) → md ← also the new default (was `small`)
+ * medium (48px) → lg
+ * large (128px) → xl
+ *
+ * The default size shifts from `small` to `md`, but that is the SAME 36px, so
+ * call sites that relied on the default need no change.
+ *
+ * ## Precision
+ *
+ * `small`, `medium`, and `large` are common English words that appear as
+ * unrelated string/type literals (priorities, statuses, breakpoints, …). To
+ * avoid corrupting those, the three AMBIGUOUS names are renamed ONLY in a
+ * precise context: a `size` JSX attribute on a component that resolves to an
+ * Avatar/AvatarGroup import (alias-aware).
+ *
+ * `tiny` and `xsmall` are unique to Avatar's scale, so they are additionally
+ * renamed in context-blind positions (object properties keyed `size`/`*Size`,
+ * Storybook `options` arrays, and size-typed union literals) within files that
+ * import Avatar/AvatarGroup.
+ */
+
+export const meta = {
+ title: 'Rename Avatar named sizes tiny/xsmall/small/medium/large → xsm/sm/md/lg/xl',
+ description:
+ 'Avatar and AvatarGroup adopt Icon\'s abbreviated size scale ' +
+ '(xsm/sm/md/lg/xl). Pixel values are unchanged; the default moves from ' +
+ '`small` to `md` (both 36px). The ambiguous names small/medium/large are ' +
+ 'only renamed on Avatar/AvatarGroup `size` JSX attributes; the unique ' +
+ 'names tiny/xsmall are also renamed in size-keyed props, Storybook ' +
+ 'options, and union types in files importing Avatar/AvatarGroup.',
+ pr: '#2672',
+};
+
+/** Import sources that provide the Astryx Avatar/AvatarGroup components. */
+const IMPORT_SOURCES = new Set([
+ '@astryxdesign/core',
+ '@astryxdesign/core/Avatar',
+ '@astryxdesign/core/AvatarGroup',
+ '@xds/core',
+ '@xds/core/Avatar',
+ '@xds/core/AvatarGroup',
+]);
+
+/** Component names whose `size` prop is renamed. */
+const TARGET_IMPORTED_NAMES = new Set(['Avatar', 'AvatarGroup']);
+
+/** Old → new size-name mapping. */
+const RENAMES = new Map([
+ ['tiny', 'xsm'],
+ ['xsmall', 'sm'],
+ ['small', 'md'],
+ ['medium', 'lg'],
+ ['large', 'xl'],
+]);
+
+/**
+ * Ambiguous names — common words that must ONLY be renamed in a precise
+ * context. `tiny`/`xsmall` are omitted because they are unique to Avatar's
+ * scale; their presence in a collection proves it is an Avatar size enum.
+ */
+const AMBIGUOUS = new Set(['small', 'medium', 'large']);
+
+/** Names that appear only in Avatar's scale — safe signals of Avatar sizing. */
+const UNIQUE = new Set(['tiny', 'xsmall']);
+
+/**
+ * Rename a string-literal node if its value is an old size name.
+ * Unwraps `'small' as const`. In non-precise contexts, ambiguous names are
+ * skipped. Returns true when a rename occurred.
+ */
+function renameValue(node, {precise = false} = {}) {
+ if (!node) return false;
+ const target = node.type === 'TSAsExpression' ? node.expression : node;
+ const isString =
+ target.type === 'StringLiteral' || target.type === 'Literal';
+ if (!isString || typeof target.value !== 'string') return false;
+ const replacement = RENAMES.get(target.value);
+ if (!replacement) return false;
+ if (!precise && AMBIGUOUS.has(target.value)) return false;
+ target.value = replacement;
+ if (target.raw) target.raw = undefined;
+ return true;
+}
+
+/** Extract a plain string value from a literal-ish node, or null. */
+function literalString(node) {
+ const target = node?.type === 'TSAsExpression' ? node.expression : node;
+ if (
+ target &&
+ (target.type === 'StringLiteral' || target.type === 'Literal') &&
+ typeof target.value === 'string'
+ ) {
+ return target.value;
+ }
+ return null;
+}
+
+export default function transformer(file, api) {
+ const j = api.jscodeshift;
+ const root = j(file.source);
+ let hasChanges = false;
+
+ // Track alias-aware local names for the target components.
+ const targetLocals = new Set();
+ root.find(j.ImportDeclaration).forEach((path) => {
+ if (!IMPORT_SOURCES.has(path.node.source.value)) return;
+ for (const spec of path.node.specifiers ?? []) {
+ if (
+ spec.type === 'ImportSpecifier' &&
+ TARGET_IMPORTED_NAMES.has(spec.imported.name)
+ ) {
+ targetLocals.add(spec.local.name);
+ }
+ }
+ });
+
+ if (targetLocals.size === 0) return undefined;
+
+ function renameArrayElements(node) {
+ let arr = node;
+ if (arr.type === 'TSAsExpression') arr = arr.expression;
+ if (arr.type !== 'ArrayExpression') return;
+ // If the array contains a name unique to Avatar's scale (tiny/xsmall), the
+ // whole collection is unambiguously the Avatar size enum, so it is safe to
+ // rename the ambiguous members too. Otherwise stay conservative.
+ const precise = arr.elements.some((el) => UNIQUE.has(literalString(el)));
+ for (const el of arr.elements) {
+ if (renameValue(el, {precise})) hasChanges = true;
+ }
+ }
+
+ // 1. `size` JSX attributes on target components — PRECISE (component known),
+ // so all five names, including the ambiguous ones, are renamed here.
+ root.find(j.JSXOpeningElement).forEach((path) => {
+ const name = path.node.name;
+ const componentName = name.type === 'JSXIdentifier' ? name.name : null;
+ if (!componentName || !targetLocals.has(componentName)) return;
+
+ for (const attr of path.node.attributes) {
+ if (attr.type !== 'JSXAttribute' || attr.name?.name !== 'size') continue;
+ const value = attr.value;
+
+ // size="small"
+ if (renameValue(value, {precise: true})) {
+ hasChanges = true;
+ continue;
+ }
+ if (
+ value &&
+ value.type === 'JSXExpressionContainer' &&
+ value.expression
+ ) {
+ // size={'small'}
+ if (renameValue(value.expression, {precise: true})) {
+ hasChanges = true;
+ continue;
+ }
+ // size={cond ? 'small' : 'large'}
+ if (value.expression.type === 'ConditionalExpression') {
+ if (renameValue(value.expression.consequent, {precise: true}))
+ hasChanges = true;
+ if (renameValue(value.expression.alternate, {precise: true}))
+ hasChanges = true;
+ }
+ }
+ }
+ });
+
+ // 2. Object properties keyed `size` (or `*Size`) + Storybook `options`
+ // arrays — NON-PRECISE (the component isn't known here), so only the
+ // unique names tiny/xsmall are renamed.
+ const PropertyType = j.ObjectProperty ?? j.Property;
+ root.find(PropertyType).forEach((path) => {
+ const key = path.node.key;
+ const keyName =
+ key.type === 'Identifier'
+ ? key.name
+ : key.type === 'StringLiteral' || key.type === 'Literal'
+ ? key.value
+ : null;
+ if (typeof keyName !== 'string') return;
+
+ const lower = keyName.toLowerCase();
+ if (lower !== 'size' && !lower.endsWith('size')) return;
+
+ const value = path.node.value;
+ // size: 'tiny'
+ if (renameValue(value)) {
+ hasChanges = true;
+ return;
+ }
+ // size: { control: 'select', options: ['tiny', ...] }
+ if (value.type === 'ObjectExpression') {
+ const optionsProp = value.properties.find(
+ (p) => p.key && (p.key.name === 'options' || p.key.value === 'options'),
+ );
+ if (optionsProp) renameArrayElements(optionsProp.value);
+ }
+ // size: ['tiny', 'xsmall', ...]
+ renameArrayElements(value);
+ });
+
+ // 3. Union-type literals — NON-PRECISE, so only the unique names tiny/xsmall
+ // are renamed. This avoids corrupting unrelated unions that happen to use
+ // common words like 'medium' (e.g. a priority or breakpoint type) in a
+ // file that also imports Avatar.
+ root.find(j.TSLiteralType).forEach((path) => {
+ if (renameValue(path.node.literal)) hasChanges = true;
+ });
+
+ // 4. Standalone array literals whose members are exactly the Avatar size
+ // scale (identified by the presence of a unique name like tiny/xsmall) —
+ // e.g. `(['tiny', 'xsmall', 'small', 'medium', 'large'] as const).map(...)`
+ // used to render every size. The unique name proves the whole array is the
+ // Avatar enum, so its ambiguous members can be renamed safely.
+ root.find(j.ArrayExpression).forEach((path) => {
+ renameArrayElements(path.node);
+ });
+
+ if (!hasChanges) return undefined;
+ return root.toSource({quote: 'single'});
+}
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarFallbackChain.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarFallbackChain.tsx
index 2c7bc8d8a8..2a2410c637 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarFallbackChain.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarFallbackChain.tsx
@@ -13,7 +13,7 @@ export default function AvatarFallbackChain() {
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Daniela-Gimenez.png"
name="Daniela Gimenez"
- size="medium"
+ size="lg"
/>
<Text type="supporting">Valid src</Text>
</HStack>
@@ -22,7 +22,7 @@ export default function AvatarFallbackChain() {
src="https://lookaside.facebook.com/assets/astryx/does-not-exist-primary.jpg"
fallbackSrc="https://lookaside.facebook.com/assets/astryx/DATA-Ami-Pena.png"
name="Invalid User"
- size="medium"
+ size="lg"
/>
<Text type="supporting">Invalid src, valid fallbackSrc</Text>
</HStack>
@@ -31,14 +31,14 @@ export default function AvatarFallbackChain() {
src="https://lookaside.facebook.com/assets/astryx/does-not-exist-primary.jpg"
fallbackSrc="https://lookaside.facebook.com/assets/astryx/does-not-exist-fallback.jpg"
name="Test User"
- size="medium"
+ size="lg"
/>
<Text type="supporting">Both invalid, has name</Text>
</HStack>
<HStack gap={3} vAlign="center">
<Avatar
src="https://lookaside.facebook.com/assets/astryx/does-not-exist-primary.jpg"
- size="medium"
+ size="lg"
/>
<Text type="supporting">All invalid, no name</Text>
</HStack>
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarGroup.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarGroup.tsx
index 94d8c46c85..df309ca637 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarGroup.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarGroup.tsx
@@ -37,7 +37,7 @@ export default function AvatarGroupBlock() {
<Text type="supporting" color="secondary">
Team members
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.map(user => (
<Avatar key={user.name} src={user.src} name={user.name} />
))}
@@ -48,7 +48,7 @@ export default function AvatarGroupBlock() {
<Text type="supporting" color="secondary">
Larger group
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(user => (
<Avatar key={user.name} src={user.src} name={user.name} />
))}
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx
index 6457990d1d..41f0073650 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarInitialsFallback.tsx
@@ -18,7 +18,7 @@ export default function AvatarInitialsFallback() {
<Stack direction="horizontal" gap={6} vAlign="center">
{NAMES.map(({name, note}) => (
<Stack key={name} direction="vertical" gap={2} hAlign="center">
- <Avatar name={name} size="medium" />
+ <Avatar name={name} size="lg" />
<Text type="supporting" color="secondary">
{note}
</Text>
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx
index bbf8ad381e..4ef61b90d5 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarShowcase.tsx
@@ -11,23 +11,23 @@ export default function AvatarShowcase() {
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Ana-Thomas.png"
name="Ana Thomas"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Drew-Young.png"
name="Drew Young"
- size="large"
+ size="xl"
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Jihoo-Song.png"
name="Jihoo Song"
- size="large"
+ size="xl"
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Nam-Tran.png"
name="Nam Tran"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="error" label="Online" />}
/>
</Stack>
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarUserCard.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarUserCard.tsx
index 41b00bff19..f54fcd2356 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarUserCard.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarUserCard.tsx
@@ -35,7 +35,7 @@ export default function AvatarUserCard() {
<Avatar
src={user.src}
name={user.name}
- size="medium"
+ size="lg"
status={
<AvatarStatusDot variant={user.variant} label={user.variant} />
}
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarWithImage.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarWithImage.tsx
index bf87636693..023b028dc1 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarWithImage.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarWithImage.tsx
@@ -11,22 +11,22 @@ export default function AvatarWithImage() {
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Ami-Pena.png"
name="Ami Pena"
- size="tiny"
+ size="xsm"
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Ana-Thomas.png"
name="Ana Thomas"
- size="small"
+ size="md"
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Daniela-Gimenez.png"
name="Daniela Gimenez"
- size="medium"
+ size="lg"
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Gabriela-Fernandez.png"
name="Gabriela Fernandez"
- size="large"
+ size="xl"
/>
</Stack>
);
diff --git a/packages/cli/templates/blocks/components/Avatar/AvatarWithStatus.tsx b/packages/cli/templates/blocks/components/Avatar/AvatarWithStatus.tsx
index 9f99736e33..052cac6527 100644
--- a/packages/cli/templates/blocks/components/Avatar/AvatarWithStatus.tsx
+++ b/packages/cli/templates/blocks/components/Avatar/AvatarWithStatus.tsx
@@ -11,19 +11,19 @@ export default function AvatarWithStatus() {
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Itai-Jordaan.png"
name="Itai Jordaan"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Margot-Schroder.png"
name="Margot Schroder"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="neutral" label="Offline" />}
/>
<Avatar
src="https://lookaside.facebook.com/assets/astryx/DATA-Pablo-Morales.png"
name="Pablo Morales"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="error" label="Busy" />}
/>
</Stack>
diff --git a/packages/cli/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx b/packages/cli/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx
index 67e32bc9e5..89e3354d19 100644
--- a/packages/cli/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx
+++ b/packages/cli/templates/blocks/components/AvatarGroup/AvatarGroupShowcase.tsx
@@ -36,7 +36,7 @@ export default function AvatarGroupShowcase() {
<Text type="supporting" color="secondary">
Team members
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.map(u => (
<Avatar key={u.key} name={u.name} />
))}
@@ -46,7 +46,7 @@ export default function AvatarGroupShowcase() {
<Text type="supporting" color="secondary">
With overflow
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 3).map(u => (
<Avatar key={u.key} name={u.name} />
))}
diff --git a/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx b/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx
index 856a4b15e1..0ffc2eab6a 100644
--- a/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx
+++ b/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowCustomText.tsx
@@ -24,7 +24,7 @@ export default function AvatarGroupOverflowCustomText() {
<Text type="supporting" color="secondary">
Team members
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{TEAM.map(member => (
<Avatar key={member.name} name={member.name} />
))}
diff --git a/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx b/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx
index 563fae61a4..7431aa1a2a 100644
--- a/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx
+++ b/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowDefault.tsx
@@ -24,7 +24,7 @@ export default function AvatarGroupOverflowDefault() {
<Text type="supporting" color="secondary">
Reviewers
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{REVIEWERS.map(reviewer => (
<Avatar key={reviewer.name} name={reviewer.name} />
))}
diff --git a/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx b/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx
index d67d9f8f2f..7407cecdc2 100644
--- a/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx
+++ b/packages/cli/templates/blocks/components/AvatarGroupOverflow/AvatarGroupOverflowShowcase.tsx
@@ -25,7 +25,7 @@ export default function AvatarGroupOverflowShowcase() {
<Text type="supporting" color="secondary">
Default overflow
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.map(user => (
<Avatar key={user.name} name={user.name} />
))}
@@ -36,7 +36,7 @@ export default function AvatarGroupOverflowShowcase() {
<Text type="supporting" color="secondary">
Custom count text
</Text>
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{USERS.slice(0, 2).map(user => (
<Avatar key={user.name} name={user.name} />
))}
diff --git a/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx b/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx
index 6fa6643df2..26f4a69fbc 100644
--- a/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx
+++ b/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotShowcase.tsx
@@ -10,17 +10,17 @@ export default function AvatarStatusDotShowcase() {
<HStack gap={4} vAlign="center">
<Avatar
name="Online User"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
<Avatar
name="Away User"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="neutral" label="Away" />}
/>
<Avatar
name="Busy User"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="error" label="Busy" />}
/>
</HStack>
diff --git a/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx b/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx
index 933edf8ce6..ad3b7c2aad 100644
--- a/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx
+++ b/packages/cli/templates/blocks/components/AvatarStatusDot/AvatarStatusDotVariants.tsx
@@ -10,17 +10,17 @@ export default function AvatarStatusDotVariants() {
<HStack gap={4} vAlign="center">
<Avatar
name="Ana Silva"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
<Avatar
name="Ben Okafor"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="neutral" label="Away" />}
/>
<Avatar
name="Cleo Marsh"
- size="large"
+ size="xl"
status={<AvatarStatusDot variant="error" label="Do not disturb" />}
/>
</HStack>
diff --git a/packages/cli/templates/blocks/components/Carousel/CarouselSnap.tsx b/packages/cli/templates/blocks/components/Carousel/CarouselSnap.tsx
index 7ba3ddfb90..e42e1a5080 100644
--- a/packages/cli/templates/blocks/components/Carousel/CarouselSnap.tsx
+++ b/packages/cli/templates/blocks/components/Carousel/CarouselSnap.tsx
@@ -27,7 +27,7 @@ export default function CarouselSnap() {
{TEAM.map(person => (
<Card key={person.name} width={180} minHeight={140}>
<Stack direction="vertical" gap={3} hAlign="center">
- <Avatar name={person.name} size="medium" />
+ <Avatar name={person.name} size="lg" />
<Stack direction="vertical" gap={1} hAlign="center">
<Text type="body" weight="bold">
{person.name}
diff --git a/packages/cli/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx b/packages/cli/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx
index f39c1bf7fa..443b752ad2 100644
--- a/packages/cli/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx
+++ b/packages/cli/templates/blocks/components/ChatMessage/ChatMessageAvatarName.tsx
@@ -17,7 +17,7 @@ export default function ChatMessageAvatarName() {
<ChatMessageList style={{maxWidth: 500}}>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble
name={
<Text type="supporting" weight="semibold" color="secondary">
@@ -50,7 +50,7 @@ export default function ChatMessageAvatarName() {
</ChatMessage>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble
name={
<Text type="supporting" weight="semibold" color="secondary">
diff --git a/packages/cli/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx b/packages/cli/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx
index 5c22d67354..399c535430 100644
--- a/packages/cli/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx
+++ b/packages/cli/templates/blocks/components/ChatMessage/ChatMessageMultiBubble.tsx
@@ -37,7 +37,7 @@ export default function ChatMessageMultiBubble() {
</ChatMessage>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble
group="first"
name={
diff --git a/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx b/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx
index eb5a3eb7fb..beba474393 100644
--- a/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx
+++ b/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleGrouping.tsx
@@ -17,7 +17,7 @@ export default function ChatMessageBubbleGrouping() {
<ChatMessageList style={{maxWidth: 500}}>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble
group="first"
name={
diff --git a/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx b/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx
index e20a45e0f9..31f6075f21 100644
--- a/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx
+++ b/packages/cli/templates/blocks/components/ChatMessageBubble/ChatMessageBubbleMetadata.tsx
@@ -20,7 +20,7 @@ export default function ChatMessageBubbleMetadata() {
<ChatMessageList style={{maxWidth: 500}}>
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble
name={
<Text type="supporting" weight="semibold" color="secondary">
diff --git a/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx b/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx
index 25b3faf29e..42e87bc953 100644
--- a/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx
+++ b/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListDensity.tsx
@@ -16,9 +16,9 @@ import {Fragment} from 'react';
const DENSITIES = ['compact', 'balanced', 'spacious'] as const;
const AVATAR_SIZE = {
- compact: 'xsmall' as const,
- balanced: 'small' as const,
- spacious: 'small' as const,
+ compact: 'sm' as const,
+ balanced: 'md' as const,
+ spacious: 'md' as const,
};
export default function ChatMessageListDensity() {
@@ -34,15 +34,11 @@ export default function ChatMessageListDensity() {
<VStack style={{flex: 1, minHeight: 0}}>
<ChatMessageList density={density}>
<ChatMessage sender="user">
- <ChatMessageBubble>
- How does density work?
- </ChatMessageBubble>
+ <ChatMessageBubble>How does density work?</ChatMessageBubble>
</ChatMessage>
<ChatMessage
sender="assistant"
- avatar={
- <Avatar name="Agent" size={AVATAR_SIZE[density]} />
- }>
+ avatar={<Avatar name="Agent" size={AVATAR_SIZE[density]} />}>
<ChatMessageBubble>
Density provides default spacing at every level — message
gap, bubble padding, and gap between child elements. Use gap
diff --git a/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx b/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx
index 48c56876b6..504f758717 100644
--- a/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx
+++ b/packages/cli/templates/blocks/components/ChatMessageList/ChatMessageListFullFeatured.tsx
@@ -42,7 +42,7 @@ export default function ChatMessageListFullFeatured() {
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble group="first">
<Markdown density="compact">
{`Sure! Here's the key pattern from **useReducer.ts**:`}
diff --git a/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx b/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx
index 6a6209595b..08f264bac4 100644
--- a/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx
+++ b/packages/cli/templates/blocks/components/HoverCard/HoverCardShowcase.tsx
@@ -15,7 +15,7 @@ export default function HoverCardShowcase() {
content={
<Stack direction="vertical" gap={2} style={{width: 240}}>
<Stack direction="horizontal" gap={2} vAlign="center">
- <Avatar name="Jane Doe" size="medium" />
+ <Avatar name="Jane Doe" size="lg" />
<Stack direction="vertical" gap={0}>
<Heading level={5}>Jane Doe</Heading>
<Text type="supporting" color="secondary">
diff --git a/packages/cli/templates/blocks/components/Item/ItemWithMedia.tsx b/packages/cli/templates/blocks/components/Item/ItemWithMedia.tsx
index 1b47749848..aacf515491 100644
--- a/packages/cli/templates/blocks/components/Item/ItemWithMedia.tsx
+++ b/packages/cli/templates/blocks/components/Item/ItemWithMedia.tsx
@@ -13,14 +13,14 @@ export default function ItemWithMedia() {
return (
<Stack gap={0}>
<Item
- startContent={<Avatar name="Ada Lovelace" size="xsmall" />}
+ startContent={<Avatar name="Ada Lovelace" size="sm" />}
label="Ada Lovelace"
description="Design systems engineer"
endContent={<Badge label="Owner" variant="purple" />}
onClick={() => {}}
/>
<Item
- startContent={<Avatar name="Grace Hopper" size="xsmall" />}
+ startContent={<Avatar name="Grace Hopper" size="sm" />}
label="Grace Hopper"
description="Compiler platform"
endContent={<Text color="secondary">Online</Text>}
diff --git a/packages/cli/templates/blocks/components/ListItem/ListItemWithMedia.tsx b/packages/cli/templates/blocks/components/ListItem/ListItemWithMedia.tsx
index 6b11165248..e23a77c8cf 100644
--- a/packages/cli/templates/blocks/components/ListItem/ListItemWithMedia.tsx
+++ b/packages/cli/templates/blocks/components/ListItem/ListItemWithMedia.tsx
@@ -13,14 +13,14 @@ export default function ListItemWithMedia() {
<ListItem
label="Ada Lovelace"
description="Design systems engineer"
- startContent={<Avatar name="Ada Lovelace" size="xsmall" />}
+ startContent={<Avatar name="Ada Lovelace" size="sm" />}
endContent={<Badge label="Owner" variant="purple" />}
onClick={() => {}}
/>
<ListItem
label="Grace Hopper"
description="Platform infrastructure"
- startContent={<Avatar name="Grace Hopper" size="xsmall" />}
+ startContent={<Avatar name="Grace Hopper" size="sm" />}
endContent={<Badge label="On call" variant="blue" />}
onClick={() => {}}
/>
diff --git a/packages/cli/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx b/packages/cli/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx
index 04377128a3..bf09b749e0 100644
--- a/packages/cli/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx
+++ b/packages/cli/templates/blocks/components/Pagination/PaginationDotsCarousel.tsx
@@ -62,12 +62,8 @@ export default function PaginationDotsCarousel() {
<Stack direction="vertical" gap={3}>
<Stars count={review.stars} />
<Text type="body">{review.quote}</Text>
- <Stack
- direction="horizontal"
- gap={3}
- vAlign="center"
- hAlign="start">
- <Avatar name={review.name} size="small" />
+ <Stack direction="horizontal" gap={3} vAlign="center" hAlign="start">
+ <Avatar name={review.name} size="md" />
<Stack direction="vertical" gap={0}>
<Text type="supporting" weight="bold">
{review.name}
diff --git a/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx b/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx
index 2d472958d4..278873372b 100644
--- a/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx
+++ b/packages/cli/templates/blocks/components/Stack/StackFillItem.tsx
@@ -17,13 +17,9 @@ export default function StackFillItem() {
return (
<Stack direction="vertical" gap={3} width="100%" style={{maxWidth: 300}}>
{USERS.map(user => (
- <Stack
- key={user.name}
- direction="horizontal"
- gap={3}
- vAlign="center">
+ <Stack key={user.name} direction="horizontal" gap={3} vAlign="center">
<StackItem size="static">
- <Avatar name={user.name} size="small" />
+ <Avatar name={user.name} size="md" />
</StackItem>
<StackItem size="fill">
<Stack direction="vertical" gap={0}>
diff --git a/packages/cli/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx b/packages/cli/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx
index a122561a1d..b61db9eaa7 100644
--- a/packages/cli/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx
+++ b/packages/cli/templates/blocks/components/TypeaheadItem/TypeaheadItemShowcase.tsx
@@ -40,7 +40,7 @@ export default function TypeaheadItemShowcase() {
renderItem={(item: PersonItem) => (
<TypeaheadItem
item={item}
- icon={<Avatar name={item.label} size="small" />}
+ icon={<Avatar name={item.label} size="md" />}
description={item.auxiliaryData.role}
/>
)}
diff --git a/packages/cli/templates/pages/ai-chat/page.tsx b/packages/cli/templates/pages/ai-chat/page.tsx
index a7f1ff7604..7665e4c345 100644
--- a/packages/cli/templates/pages/ai-chat/page.tsx
+++ b/packages/cli/templates/pages/ai-chat/page.tsx
@@ -390,7 +390,7 @@ export default function AIChatConversationTemplate() {
{/* Assistant message: tool calls, markdown, code block */}
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble variant="ghost">
Looking into the auth files now. Let me read through the
code and trace the token refresh flow.
@@ -510,7 +510,7 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
{/* Assistant message: test results table + code block */}
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatToolCalls
defaultIsExpanded
calls={[
@@ -608,7 +608,7 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
{/* Assistant message: artifact card */}
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble variant="ghost">
<Markdown density="compact">
{`I've drafted a design doc covering the problem, the fix, and the test matrix — pulling straight from the changes we just made.\n\nOpen the document below to review it. Want me to expand any section?`}
@@ -647,7 +647,7 @@ The fix is to catch \`TokenExpiredError\` specifically and attempt a refresh bef
{/* Assistant message: in-progress tool call */}
<ChatMessage
sender="assistant"
- avatar={<Avatar name="Agent" size="small" />}>
+ avatar={<Avatar name="Agent" size="md" />}>
<ChatMessageBubble variant="ghost">
<Markdown density="compact">
{`On it — adding a **Rollout & Monitoring** section with a staged flag ramp and the alert thresholds. Updating the document now.`}
diff --git a/packages/cli/templates/pages/dashboard-portfolio/page.tsx b/packages/cli/templates/pages/dashboard-portfolio/page.tsx
index edb59983cd..60e2ae90fe 100644
--- a/packages/cli/templates/pages/dashboard-portfolio/page.tsx
+++ b/packages/cli/templates/pages/dashboard-portfolio/page.tsx
@@ -4,12 +4,7 @@
import {useState} from 'react';
-import {
- VStack,
- HStack,
- Layout,
- LayoutContent,
-} from '@astryxdesign/core/Layout';
+import {VStack, HStack, Layout, LayoutContent} from '@astryxdesign/core/Layout';
import {Text, Heading} from '@astryxdesign/core/Text';
import {Card} from '@astryxdesign/core/Card';
import {Grid, GridSpan} from '@astryxdesign/core/Grid';
@@ -642,7 +637,7 @@ function AssetRow({
label={<Text weight="bold">{ticker}</Text>}
description={name}
href="#"
- startContent={<Avatar name={ticker} size="small" />}
+ startContent={<Avatar name={ticker} size="md" />}
endContent={
<VStack gap={0} hAlign="end">
<Text type="body">{value}</Text>
@@ -693,10 +688,7 @@ export default function DashboardPortfolioTemplate() {
{/* KPI metric cards */}
<Grid columns={{minWidth: 280, repeat: 'fit'}} gap={4}>
{Array.from({length: Math.ceil(metrics.length / 2)}, (_, i) => (
- <Grid
- key={i}
- columns={{minWidth: 280, repeat: 'fit'}}
- gap={4}>
+ <Grid key={i} columns={{minWidth: 280, repeat: 'fit'}} gap={4}>
{metrics.slice(i * 2, i * 2 + 2).map(m => (
<MetricCard key={m.label} {...m} />
))}
diff --git a/packages/cli/templates/pages/detail-page/page.tsx b/packages/cli/templates/pages/detail-page/page.tsx
index b71b2b1739..1564fd7f7f 100644
--- a/packages/cli/templates/pages/detail-page/page.tsx
+++ b/packages/cli/templates/pages/detail-page/page.tsx
@@ -199,7 +199,7 @@ function PageHeader({
</Text>
<HStack gap={1} vAlign="center">
<Bullet />
- <Avatar name="Jane Doe" size="xsmall" />
+ <Avatar name="Jane Doe" size="sm" />
<Text type="body" maxLines={1}>
Jane Doe
</Text>
@@ -444,7 +444,7 @@ function TimelineSection() {
{ACTIVITY.map((item, i) => (
<VStack key={i} gap={2}>
<HStack gap={3} vAlign="start">
- <Avatar name={item.user} size="small" />
+ <Avatar name={item.user} size="md" />
<StackItem size="fill">
<VStack gap={2}>
<Card variant="muted" padding={3}>
@@ -478,11 +478,7 @@ function TimelineSection() {
size="xsm"
color="secondary"
/>
- <Icon
- icon={HeartIcon}
- size="xsm"
- color="secondary"
- />
+ <Icon icon={HeartIcon} size="xsm" color="secondary" />
<Text type="supporting" color="secondary">
{item.reactions}
</Text>
@@ -533,16 +529,13 @@ function PanelContent() {
321 Smith Road, CA 38238
</MetadataListItem>
<MetadataListItem label="Phone">234-</MetadataListItem>
- <MetadataListItem label="Email">
- </MetadataListItem>
+ <MetadataListItem label="Email">[email protected]</MetadataListItem>
<MetadataListItem label="Billing Address">
Same as shipping address
</MetadataListItem>
</MetadataList>
</Collapsible>
- <Collapsible
- trigger={<Heading level={4}>Fraud Analysis</Heading>}>
+ <Collapsible trigger={<Heading level={4}>Fraud Analysis</Heading>}>
<VStack gap={1}>
<ProgressBar
label="Risk level"
diff --git a/packages/cli/templates/pages/documentation-design/page.tsx b/packages/cli/templates/pages/documentation-design/page.tsx
index 35089034aa..7e993353ea 100644
--- a/packages/cli/templates/pages/documentation-design/page.tsx
+++ b/packages/cli/templates/pages/documentation-design/page.tsx
@@ -541,7 +541,7 @@ function ComponentDetailView({activeNav}: {activeNav: string}) {
endContent={<Badge label="New" variant="info" />}
/>
),
- avatar: <Avatar name="Alice" size="medium" />,
+ avatar: <Avatar name="Alice" size="lg" />,
badge: <Badge label="Success" variant="success" />,
card: (
<Card>
diff --git a/packages/cli/templates/pages/messaging-shell/page.tsx b/packages/cli/templates/pages/messaging-shell/page.tsx
index 758b739233..d684cb2e3a 100644
--- a/packages/cli/templates/pages/messaging-shell/page.tsx
+++ b/packages/cli/templates/pages/messaging-shell/page.tsx
@@ -337,7 +337,7 @@ function StreamMessageGroup({message}: {message: StreamMessage}) {
return (
<ChatMessage
sender={isSelf ? 'user' : 'assistant'}
- avatar={isSelf ? undefined : <Avatar name={user.name} size="small" />}>
+ avatar={isSelf ? undefined : <Avatar name={user.name} size="md" />}>
{message.bubbles.map((text, index) => (
<ChatMessageBubble
key={`${message.id}-${index}`}
@@ -395,7 +395,7 @@ export default function MessagingShellPage() {
const workspaceRail = (
<VStack gap={2} style={styles.rail}>
- <Avatar name="Astryx HQ" size="small" />
+ <Avatar name="Astryx HQ" size="md" />
{RAIL_ITEMS.map(item => (
<IconButton
key={item.id}
@@ -416,7 +416,7 @@ export default function MessagingShellPage() {
/>
<Avatar
name={USERS.you.name}
- size="small"
+ size="md"
status={<AvatarStatusDot variant="success" label="Online" />}
/>
</VStack>
@@ -497,7 +497,7 @@ export default function MessagingShellPage() {
startContent={
<Avatar
name={USERS[dm.userId].name}
- size="xsmall"
+ size="sm"
status={
<AvatarStatusDot
variant={PRESENCE_VARIANT[dm.presence]}
@@ -600,9 +600,7 @@ export default function MessagingShellPage() {
<ChatMessageList density="compact">
<ChatMessage
sender="assistant"
- avatar={
- <Avatar name={USERS[THREAD_ROOT.userId].name} size="small" />
- }>
+ avatar={<Avatar name={USERS[THREAD_ROOT.userId].name} size="md" />}>
<ChatMessageBubble
name={USERS[THREAD_ROOT.userId].name}
metadata={
@@ -622,7 +620,7 @@ export default function MessagingShellPage() {
<ChatMessage
key={reply.id}
sender="assistant"
- avatar={<Avatar name={USERS[reply.userId].name} size="small" />}>
+ avatar={<Avatar name={USERS[reply.userId].name} size="md" />}>
<ChatMessageBubble
name={USERS[reply.userId].name}
metadata={
diff --git a/packages/cli/templates/pages/table-grouped/page.tsx b/packages/cli/templates/pages/table-grouped/page.tsx
index 9cb4f8de33..e2346be803 100644
--- a/packages/cli/templates/pages/table-grouped/page.tsx
+++ b/packages/cli/templates/pages/table-grouped/page.tsx
@@ -22,7 +22,10 @@ import {Badge} from '@astryxdesign/core/Badge';
import {Avatar} from '@astryxdesign/core/Avatar';
import {Selector} from '@astryxdesign/core/Selector';
import {PowerSearch} from '@astryxdesign/core/PowerSearch';
-import type {PowerSearchConfig, PowerSearchFilter} from '@astryxdesign/core/PowerSearch';
+import type {
+ PowerSearchConfig,
+ PowerSearchFilter,
+} from '@astryxdesign/core/PowerSearch';
import {Dialog, DialogHeader} from '@astryxdesign/core/Dialog';
import {Popover} from '@astryxdesign/core/Popover';
import {RadioList, RadioListItem} from '@astryxdesign/core/RadioList';
@@ -798,19 +801,15 @@ function TaskDetailPanel({
</MetadataListItem>
<MetadataListItem label="Assignee">
<HStack gap={2} vAlign="center">
- <Avatar name={task.assignee} size="xsmall" />
+ <Avatar name={task.assignee} size="sm" />
<Text type="body">{task.assignee}</Text>
</HStack>
</MetadataListItem>
<MetadataListItem label="Project">
{task.project || '\u2014'}
</MetadataListItem>
- <MetadataListItem label="Created">
- {task.created}
- </MetadataListItem>
- <MetadataListItem label="Updated">
- {task.updated}
- </MetadataListItem>
+ <MetadataListItem label="Created">{task.created}</MetadataListItem>
+ <MetadataListItem label="Updated">{task.updated}</MetadataListItem>
</MetadataList>
{task.tags.length > 0 && (
@@ -942,11 +941,7 @@ export default function DataTableTemplate() {
</RadioList>
</VStack>
}>
- <Button
- label="View Options"
- variant="secondary"
- size="md"
- />
+ <Button label="View Options" variant="secondary" size="md" />
</Popover>
</HStack>
</VStack>
@@ -1066,7 +1061,7 @@ export default function DataTableTemplate() {
</Text>
</TableCell>
<TableCell>
- <Avatar name={task.assignee} size="xsmall" />
+ <Avatar name={task.assignee} size="sm" />
</TableCell>
<TableCell>
<DropdownMenu
diff --git a/packages/cli/templates/pages/table-page-heatmap-status/page.tsx b/packages/cli/templates/pages/table-page-heatmap-status/page.tsx
index a4322423f0..f64be8e2c7 100644
--- a/packages/cli/templates/pages/table-page-heatmap-status/page.tsx
+++ b/packages/cli/templates/pages/table-page-heatmap-status/page.tsx
@@ -338,17 +338,13 @@ const columns: TableColumn<IncidentRow>[] = [
key: 'product',
header: 'Product',
width: proportional(2),
- renderCell: (item: IncidentRow) => (
- <Text type="body">{item.product}</Text>
- ),
+ renderCell: (item: IncidentRow) => <Text type="body">{item.product}</Text>,
},
{
key: 'title',
header: 'Description',
width: proportional(5),
- renderCell: (item: IncidentRow) => (
- <Text type="body">{item.title}</Text>
- ),
+ renderCell: (item: IncidentRow) => <Text type="body">{item.title}</Text>,
},
{
key: 'startTime',
@@ -362,9 +358,7 @@ const columns: TableColumn<IncidentRow>[] = [
key: 'duration',
header: 'Duration',
width: pixel(100),
- renderCell: (item: IncidentRow) => (
- <Text type="body">{item.duration}</Text>
- ),
+ renderCell: (item: IncidentRow) => <Text type="body">{item.duration}</Text>,
},
{
key: 'oncall',
@@ -375,7 +369,7 @@ const columns: TableColumn<IncidentRow>[] = [
<Avatar
name={item.oncall}
src={ONCALL_AVATARS[item.oncall]}
- size="xsmall"
+ size="sm"
/>
<Text type="body">{item.oncall}</Text>
</HStack>
@@ -396,9 +390,7 @@ const columns: TableColumn<IncidentRow>[] = [
key: 'date',
header: 'Date',
width: pixel(110),
- renderCell: (item: IncidentRow) => (
- <Text type="body">{item.date}</Text>
- ),
+ renderCell: (item: IncidentRow) => <Text type="body">{item.date}</Text>,
},
];
diff --git a/packages/cli/templates/pages/table-page/page.tsx b/packages/cli/templates/pages/table-page/page.tsx
index 9ee4db870d..d85cd91416 100644
--- a/packages/cli/templates/pages/table-page/page.tsx
+++ b/packages/cli/templates/pages/table-page/page.tsx
@@ -16,7 +16,10 @@ import {Button} from '@astryxdesign/core/Button';
import {IconButton} from '@astryxdesign/core/IconButton';
import {Icon} from '@astryxdesign/core/Icon';
import {Avatar} from '@astryxdesign/core/Avatar';
-import {PowerSearch, usePowerSearchConfig} from '@astryxdesign/core/PowerSearch';
+import {
+ PowerSearch,
+ usePowerSearchConfig,
+} from '@astryxdesign/core/PowerSearch';
import type {PowerSearchFilter} from '@astryxdesign/core/PowerSearch';
import {Table, proportional, pixel} from '@astryxdesign/core/Table';
import type {TableColumn} from '@astryxdesign/core/Table';
@@ -353,7 +356,7 @@ const columns: TableColumn<DogRow>[] = [
width: proportional(2),
renderCell: (item: DogRow) => (
<HStack gap={3} vAlign="center">
- <Avatar name={item.name} size="small" />
+ <Avatar name={item.name} size="md" />
<VStack gap={0}>
<Text type="body">{item.name}</Text>
<Text type="supporting" color="secondary">
@@ -367,9 +370,7 @@ const columns: TableColumn<DogRow>[] = [
key: 'biography',
header: 'Biography',
width: proportional(5),
- renderCell: (item: DogRow) => (
- <Text type="body">{item.biography}</Text>
- ),
+ renderCell: (item: DogRow) => <Text type="body">{item.biography}</Text>,
},
{
key: 'age',
@@ -406,10 +407,7 @@ export default function TablePageTemplate() {
icon={<Icon icon={ArrowDownTrayIcon} size="sm" />}
variant="ghost"
/>
- <Button
- label="Add"
- icon={<Icon icon={PlusIcon} size="sm" />}
- />
+ <Button label="Add" icon={<Icon icon={PlusIcon} size="sm" />} />
</HStack>
</LayoutHeader>
}
diff --git a/packages/core/src/Avatar/Avatar.doc.mjs b/packages/core/src/Avatar/Avatar.doc.mjs
index 1b0d74ffd2..89f0d2a73d 100644
--- a/packages/core/src/Avatar/Avatar.doc.mjs
+++ b/packages/core/src/Avatar/Avatar.doc.mjs
@@ -13,7 +13,7 @@ export const docs = {
'Avatar represents a person or team with a profile photo, initials, or a default icon. Use it in comment headers, contact lists, chat messages, user cards, and anywhere you need to identify someone visually.',
bestPractices: [
{guidance: true, description: 'Always pass a name so the avatar can show initials if the photo fails to load, and so screen readers can announce who it represents.'},
- {guidance: true, description: 'Pick a size that matches the context: tiny or xsmall for inline mentions, small or medium for lists and cards, large for profile headers.'},
+ {guidance: true, description: 'Pick a size that matches the context: xsm or sm for inline mentions, md or lg for lists and cards, xl for profile headers.'},
{guidance: true, description: 'Add a status dot when knowing someone\'s availability matters, like in chat or team views.'},
{guidance: false, description: 'Use Avatar for logos, product images, or anything that isn\'t a person or team. Use an image or icon instead.'},
{guidance: false, description: 'Force a square or custom shape. Avatars are always circular to stay consistent across the system.'},
@@ -55,9 +55,9 @@ export const docs = {
},
{
name: 'size',
- type: "'tiny' | 'xsmall' | 'small' | 'medium' | 'large' | number",
- description: "Avatar size. Use a named size ('tiny', 'xsmall', 'small', 'medium', 'large') or a numeric pixel value. Note: short names like 'sm', 'md', 'lg' are NOT valid; use the full words.",
- default: "'small'",
+ type: "'xsm' | 'sm' | 'md' | 'lg' | 'xl' | number",
+ description: "Avatar size. Use a named size ('xsm' 20px, 'sm' 24px, 'md' 36px, 'lg' 48px, 'xl' 128px) or a numeric pixel value. Avatar shares Icon's abbreviated scale, but its tiers are larger because avatars align with media rather than glyphs.",
+ default: "'md'",
},
{
name: 'status',
@@ -100,7 +100,7 @@ export const docsDense = {
'Avatar represents a person or team with a profile photo, initials, or a default icon. Falls back automatically. Use in comment headers, contact lists, chat, user cards.',
bestPractices: [
{guidance: true, description: 'Always pass a name for initials fallback and screen reader alt text.'},
- {guidance: true, description: 'Match size to context: tiny/xsmall inline, small/medium in lists, large for profiles.'},
+ {guidance: true, description: 'Match size to context: xsm/sm inline, md/lg in lists, xl for profiles.'},
{guidance: true, description: 'Add a status dot in chat or team views where availability matters.'},
{guidance: false, description: 'Use for logos or product images. Use an image or icon instead.'},
{guidance: false, description: 'Force a square or custom shape. Avatars are always circular.'},
@@ -111,7 +111,7 @@ export const docsDense = {
fallbackSrc: 'fallback image when primary fails',
name: 'user name for initials and alt text',
alt: 'alt text; falls back to name',
- size: "avatar size. Named ('tiny', 'xsmall', 'small', 'medium', 'large') or numeric px. Short names 'sm'/'md'/'lg' are NOT valid; use full words.",
+ size: "avatar size. Named ('xsm' 20px, 'sm' 24px, 'md' 36px, 'lg' 48px, 'xl' 128px) or numeric px.",
status: 'corner content for status indicators',
},
components: [
diff --git a/packages/core/src/Avatar/Avatar.tsx b/packages/core/src/Avatar/Avatar.tsx
index 5e08086013..2db1ef9493 100644
--- a/packages/core/src/Avatar/Avatar.tsx
+++ b/packages/core/src/Avatar/Avatar.tsx
@@ -55,9 +55,13 @@ const CIRCLE_EDGE_OFFSET_RATIO = (1 - 1 / Math.SQRT2) / 2;
const INITIALS_FONT_SIZE_RATIO = 0.4;
/**
- * Named size options
+ * Named size options.
+ *
+ * Avatar uses the same abbreviated scale as Icon (`xsm`/`sm`/`md`/`lg`/`xl`),
+ * but the values are larger because avatars align with media rather than
+ * glyphs. The tiers match EPS's avatar sizes.
*/
-type AvatarNamedSize = 'tiny' | 'xsmall' | 'small' | 'medium' | 'large';
+type AvatarNamedSize = 'xsm' | 'sm' | 'md' | 'lg' | 'xl';
/**
* Numeric size options (in pixels)
@@ -78,15 +82,15 @@ export function resolveSize(size: AvatarSize): number {
return size;
}
switch (size) {
- case 'tiny':
+ case 'xsm':
return 20;
- case 'xsmall':
+ case 'sm':
return 24;
- case 'small':
+ case 'md':
return 36;
- case 'medium':
+ case 'lg':
return 48;
- case 'large':
+ case 'xl':
return 128;
}
}
@@ -198,8 +202,9 @@ export interface AvatarProps extends BaseProps<HTMLDivElement> {
*/
name?: string;
/**
- * The size of the avatar.
- * @default 'small'
+ * The size of the avatar. A named size (`xsm` 20px, `sm` 24px, `md` 36px,
+ * `lg` 48px, `xl` 128px) or a specific pixel value.
+ * @default 'md'
*/
size?: AvatarSize;
/**
@@ -258,7 +263,7 @@ function DefaultIcon({size}: {size: number}) {
* @example
* ```
* <Avatar src="/user.jpg" name="John Doe" />
- * <Avatar name="Jane Smith" size="large" />
+ * <Avatar name="Jane Smith" size="xl" />
* <Avatar src="/user.jpg" status={<OnlineIndicator />} />
* ```
*/
@@ -267,7 +272,7 @@ export function Avatar({
'data-testid': testId,
fallbackSrc,
name,
- size = 'small',
+ size = 'md',
src,
status,
xstyle,
diff --git a/packages/core/src/Avatar/AvatarSizeContext.ts b/packages/core/src/Avatar/AvatarSizeContext.ts
index 7522f47fda..ce163b7f81 100644
--- a/packages/core/src/Avatar/AvatarSizeContext.ts
+++ b/packages/core/src/Avatar/AvatarSizeContext.ts
@@ -18,7 +18,7 @@ import {createContext} from 'react';
* Context that provides the resolved numeric avatar size (in pixels)
* to child components like AvatarStatusDot.
*
- * Default value of 36 matches the default 'small' avatar size.
+ * Default value of 36 matches the default 'md' avatar size.
*/
export const AvatarSizeContext = createContext<number>(36);
AvatarSizeContext.displayName = 'AvatarSizeContext';
diff --git a/packages/core/src/Avatar/AvatarStatusDot.tsx b/packages/core/src/Avatar/AvatarStatusDot.tsx
index d589724095..0bb5005829 100644
--- a/packages/core/src/Avatar/AvatarStatusDot.tsx
+++ b/packages/core/src/Avatar/AvatarStatusDot.tsx
@@ -168,12 +168,12 @@ const variantStyleMap: Partial<
* ```
* <Avatar
* name="John Doe"
- * size="medium"
+ * size="lg"
* status={<AvatarStatusDot variant="success" label="Online" />}
* />
* <Avatar
* name="Jane Smith"
- * size="large"
+ * size="xl"
* status={<AvatarStatusDot variant="success" label="Verified" icon={<CheckIcon />} />}
* />
* ```
diff --git a/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs b/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs
index 37809bf8f9..43475c77c1 100644
--- a/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs
+++ b/packages/core/src/AvatarGroup/AvatarGroup.doc.mjs
@@ -47,7 +47,7 @@ export const docs = {
name: 'size',
type: 'AvatarSize',
description: 'Size applied to all avatars via context.',
- default: "'small'",
+ default: "'md'",
},
{
name: 'ref',
diff --git a/packages/core/src/AvatarGroup/AvatarGroup.test.tsx b/packages/core/src/AvatarGroup/AvatarGroup.test.tsx
index 3b91238c3f..4b5ac8aef0 100644
--- a/packages/core/src/AvatarGroup/AvatarGroup.test.tsx
+++ b/packages/core/src/AvatarGroup/AvatarGroup.test.tsx
@@ -56,14 +56,14 @@ describe('AvatarGroup', () => {
it('applies size class to the group', () => {
render(
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
<Avatar name="Alice" />
</AvatarGroup>,
);
const group = screen.getByRole('group');
expect(group.className).toContain('astryx-avatar-group');
- expect(group.className).toContain('medium');
+ expect(group.className).toContain('lg');
});
it('renders empty group when no children', () => {
@@ -134,7 +134,7 @@ describe('AvatarGroupOverflow', () => {
const visibleCount = 3;
render(
- <AvatarGroup size="medium">
+ <AvatarGroup size="lg">
{users.slice(0, visibleCount).map(name => (
<Avatar key={name} name={name} />
))}
diff --git a/packages/core/src/AvatarGroup/AvatarGroup.tsx b/packages/core/src/AvatarGroup/AvatarGroup.tsx
index 7502146494..d81fb72029 100644
--- a/packages/core/src/AvatarGroup/AvatarGroup.tsx
+++ b/packages/core/src/AvatarGroup/AvatarGroup.tsx
@@ -39,7 +39,7 @@ export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
children: ReactNode;
/**
* Size applied to all avatars via context.
- * @default 'small'
+ * @default 'md'
*/
size?: AvatarSize;
/**
@@ -65,7 +65,7 @@ const styles = stylex.create({
*
* @example
* ```
- * <AvatarGroup size="medium">
+ * <AvatarGroup size="lg">
* {users.slice(0, 3).map(u => (
* <Avatar key={u.id} src={u.src} name={u.name} />
* ))}
@@ -75,7 +75,7 @@ const styles = stylex.create({
*/
export function AvatarGroup({
children,
- size = 'small',
+ size = 'md',
'data-testid': testId,
'aria-label': ariaLabelFromProps,
xstyle,
diff --git a/packages/core/src/AvatarGroup/AvatarGroupOverflow.doc.mjs b/packages/core/src/AvatarGroup/AvatarGroupOverflow.doc.mjs
index 7ca9bdafb9..aec2269768 100644
--- a/packages/core/src/AvatarGroup/AvatarGroupOverflow.doc.mjs
+++ b/packages/core/src/AvatarGroup/AvatarGroupOverflow.doc.mjs
@@ -64,7 +64,7 @@ export const docs = {
{
label: 'Default overflow count',
code: `
-<AvatarGroup size="medium">
+<AvatarGroup size="lg">
{users.slice(0, 3).map(user => (
<Avatar key={user.id} src={user.src} name={user.name} />
))}
@@ -75,7 +75,7 @@ export const docs = {
{
label: 'Custom count text',
code: `
-<AvatarGroup size="medium">
+<AvatarGroup size="lg">
{users.slice(0, 3).map(user => (
<Avatar key={user.id} src={user.src} name={user.name} />
))}
diff --git a/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx b/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx
index 3470f019c0..17be7815b0 100644
--- a/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx
+++ b/packages/core/src/AvatarGroup/AvatarGroupOverflow.tsx
@@ -116,7 +116,7 @@ const dynamicStyles = stylex.create({
*
* @example
* ```
- * <AvatarGroup size="medium">
+ * <AvatarGroup size="lg">
* {users.slice(0, 3).map(u => (
* <Avatar key={u.id} src={u.src} name={u.name} />
* ))}
diff --git a/packages/core/src/Chat/Chat.doc.mjs b/packages/core/src/Chat/Chat.doc.mjs
index 0126c0c964..06fde5d77b 100644
--- a/packages/core/src/Chat/Chat.doc.mjs
+++ b/packages/core/src/Chat/Chat.doc.mjs
@@ -80,7 +80,7 @@ export const docs = {
{ name: 'Scroll-to-bottom button', required: false, description: 'Appears when the user scrolls up or new messages arrive. Defaults to ChatLayoutScrollButton; pass null to hide or a custom element to override.' },
{ name: 'Composer', required: true, description: 'The input area for sending messages, typically ChatComposer. Docked at the bottom inside the frosted glass layer.' },
{ name: 'Empty state', required: false, description: 'Centered placeholder shown when no messages exist. Use EmptyState for a consistent look.' },
- { name: 'Avatar', required: false, description: 'A sender avatar rendered beside the message. Typically Avatar with size="small". Hidden for system messages.' },
+ { name: 'Avatar', required: false, description: 'A sender avatar rendered beside the message. Typically Avatar with size="md". Hidden for system messages.' },
{ name: 'Name', required: false, description: 'Sender name above the message body. Place on the bubble when using bubbles, or on the message wrapper for raw content.' },
{ name: 'Content', required: true, description: 'The message body: one or more ChatMessageBubble elements, or any free-form ReactNode like images or tool calls.' },
{ name: 'Metadata', required: false, description: 'Timestamp, delivery status, and footer actions below the message. Place on the last bubble or on the message wrapper.' },
diff --git a/packages/core/src/Chat/ChatMessage.tsx b/packages/core/src/Chat/ChatMessage.tsx
index a53f110bf4..0b37436a5e 100644
--- a/packages/core/src/Chat/ChatMessage.tsx
+++ b/packages/core/src/Chat/ChatMessage.tsx
@@ -150,7 +150,7 @@ const styles = stylex.create({
*
* @example
* ```
- * <ChatMessage sender="assistant" name="Navi" avatar={<Avatar name="Navi" size="small" />}>
+ * <ChatMessage sender="assistant" name="Navi" avatar={<Avatar name="Navi" size="md" />}>
* <ChatMessageBubble>Hello!</ChatMessageBubble>
* <ChatMessageMetadata timestamp="2:30 PM" />
* </ChatMessage>
@@ -222,7 +222,9 @@ export function ChatMessage({
{...rest}
ref={ref}
data-testid={testId}
- aria-label={!hasName ? t('@astryx.chatMessage.messageFrom', {sender}) : undefined}
+ aria-label={
+ !hasName ? t('@astryx.chatMessage.messageFrom', {sender}) : undefined
+ }
aria-labelledby={hasName ? nameId : undefined}
{...mergeProps(
themeProps('chat-message', {sender, density}),
diff --git a/packages/core/src/Item/Item.doc.mjs b/packages/core/src/Item/Item.doc.mjs
index 5b08e3eeeb..5d6e9fc938 100644
--- a/packages/core/src/Item/Item.doc.mjs
+++ b/packages/core/src/Item/Item.doc.mjs
@@ -28,7 +28,7 @@ export const docs = {
props: [
{name: 'label', type: 'ReactNode', description: 'Primary text identifying this item. Accepts string (auto-truncated) or ReactNode (for rich content).', required: true},
{name: 'marker', type: 'ReactNode', description: 'Marker rendered before startContent as a direct flex child. Use for list bullets/counters that need custom baseline alignment.'},
- {name: 'startContent', type: 'ReactNode', description: 'Content rendered before the label/description area, such as an icon, avatar, or checkbox.', slotElements: [{__element: 'Avatar', props: {name: 'Ada Lovelace', size: 'xsmall'}}, {__element: 'Icon', props: {icon: 'info', size: 'sm', color: 'secondary'}}]},
+ {name: 'startContent', type: 'ReactNode', description: 'Content rendered before the label/description area, such as an icon, avatar, or checkbox.', slotElements: [{__element: 'Avatar', props: {name: 'Ada Lovelace', size: 'sm'}}, {__element: 'Icon', props: {icon: 'info', size: 'sm', color: 'secondary'}}]},
{name: 'description', type: 'ReactNode', description: 'Secondary text: subtitle, description, or supporting info.'},
{name: 'endContent', type: 'ReactNode', description: 'Content rendered after the label/description area, such as badges, metadata, timestamps, or action buttons.', slotElements: [{__element: 'Badge', props: {label: 3}}, {__element: 'Text', props: {color: 'secondary'}, children: '2h ago'}]},
{name: 'as', type: "'div' | 'li' | 'span'", description: 'HTML element to render as the root.', default: "'div'"},
diff --git a/packages/core/src/Table/Table.tsx b/packages/core/src/Table/Table.tsx
index 933203f0ec..1e6045fd8e 100644
--- a/packages/core/src/Table/Table.tsx
+++ b/packages/core/src/Table/Table.tsx
@@ -275,7 +275,7 @@ function TableInner<T extends Record<string, unknown>>({
* columns={[
* { key: 'name', header: 'Name', width: proportional(1), renderCell: (u) => (
* <HStack gap={2} align="center">
- * <Avatar name={u.name} size="small" />
+ * <Avatar name={u.name} size="md" />
* <Text weight="semibold">{u.name}</Text>
* </HStack>
* )},