Skip to content

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

TypeScript

fix(cli): improve IconButton discoverability and inline icon names (#2955)

Cindy Zhang79bd3c249a1e
diff --git a/packages/core/src/Button/Button.doc.mjs b/packages/core/src/Button/Button.doc.mjs
index 539879cbf2..11ee538ad5 100644
--- a/packages/core/src/Button/Button.doc.mjs
+++ b/packages/core/src/Button/Button.doc.mjs
@@ -18,6 +18,7 @@ export const docs = {
{guidance: true, description: 'Write labels that describe the action ("Save changes", "Delete account", "Send invite"), not vague labels like "OK" or "Click here".'},
{guidance: true, description: 'Show a loading state for actions that take time, like saving or submitting, so the user knows it is working.'},
{guidance: true, description: 'Always provide a label for icon-only buttons so screen readers can announce what the button does. Add a tooltip for sighted users.'},
+ {guidance: true, description: 'For a dedicated icon-only button, use IconButton from \'@xds/core/IconButton\'. It is a separate component — not exported from \'@xds/core/Button\'.'},
{guidance: false, description: 'Place more than one primary button in the same view; this dilutes the visual hierarchy.'},
{guidance: false, description: 'Use the destructive variant without a confirmation step for irreversible actions like deleting data.'},
{guidance: false, description: 'Use a button for navigation. If it only takes the user to another page, use a link instead. Buttons are for actions like saving, deleting, or submitting.'},
@@ -94,7 +95,7 @@ export const docs = {
name: 'isIconOnly',
type: 'boolean',
description:
- 'When true, renders as a square icon-only button with label as aria-label. Requires icon.',
+ 'When true, renders as a square icon-only button with label as aria-label. Requires icon. Tip: for a dedicated icon-only button component, use IconButton from \'@xds/core/IconButton\' instead.',
default: 'false',
},
{
diff --git a/packages/core/src/Icon/Icon.doc.mjs b/packages/core/src/Icon/Icon.doc.mjs
index a63873ae2d..2748e710d3 100644
--- a/packages/core/src/Icon/Icon.doc.mjs
+++ b/packages/core/src/Icon/Icon.doc.mjs
@@ -11,7 +11,7 @@ export const docs = {
{
name: 'icon',
type: 'IconName | ComponentType<SVGProps>',
- description: 'Semantic icon name or SVG component. Run `npx astryx docs icons` for valid names. Note: this prop is called `icon`, not `name`.',
+ description: 'Semantic icon name or SVG component. Valid semantic names: close, chevronDown, chevronLeft, chevronRight, check, success, error, warning, info, calendar, clock, externalLink, menu, moreHorizontal, search, arrowUp, arrowDown, arrowsUpDown, funnel, eyeSlash, viewColumns, copy, checkDouble, wrench, stop, microphone. For any icon not in this list, pass an SVG component directly (e.g. import from lucide-react or @heroicons/react). Note: this prop is called `icon`, not `name`.',
required: true,
},
{
@@ -56,7 +56,7 @@ export const docsZh = {
{
name: 'icon',
type: 'IconName | ComponentType<SVGProps>',
- description: '语义图标名称或 SVG 组件。运行 `npx astryx docs icons` 查看可用名称。',
+ description: '语义图标名称或 SVG 组件。有效语义名称:close, chevronDown, chevronLeft, chevronRight, check, success, error, warning, info, calendar, clock, externalLink, menu, moreHorizontal, search, arrowUp, arrowDown, arrowsUpDown, funnel, eyeSlash, viewColumns, copy, checkDouble, wrench, stop, microphone。列表之外的图标请直接传入 SVG 组件。',
required: true,
},
{
@@ -112,7 +112,7 @@ export const docsDense = {
],
},
propDescriptions: {
- icon: 'Semantic icon name or SVG component. See `npx astryx docs icons`.',
+ icon: 'Semantic icon name or SVG component. Valid names: close, chevronDown, chevronLeft, chevronRight, check, success, error, warning, info, calendar, clock, externalLink, menu, moreHorizontal, search, arrowUp, arrowDown, arrowsUpDown, funnel, eyeSlash, viewColumns, copy, checkDouble, wrench, stop, microphone. For others, pass an SVG component.',
color: 'Color variant mapped to XDS icon color tokens.',
size: 'Icon size.',
},