feat(theme): add component icon mappings - #4647
Draft
cixzhang wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cixzhang
commented
Aug 2, 2026
| targets: [ | ||
| {className: 'astryx-selector', visualProps: ['size', 'status']}, | ||
| {className: 'astryx-selector-option'}, | ||
| {className: 'astryx-selector-selected-option-icon'}, |
Contributor
Author
There was a problem hiding this comment.
Should this leave a className?
| {className: 'astryx-selector-clear-icon'}, | ||
| {className: 'astryx-selector-indicator-icon', states: ['state']}, | ||
| ], | ||
| icons: [ |
Contributor
Author
There was a problem hiding this comment.
Let's also include a table for this in the docsite's canary theming section
| </span> | ||
| {isSelected && <Icon icon="check" size="sm" color="accent" />} | ||
| {isSelected && selectedOptionIcon != null && ( | ||
| <span |
Contributor
Author
There was a problem hiding this comment.
Hmm should we handle most of this logic within Icon instead?
cixzhang
force-pushed
the
feat/component-icon-mapping
branch
from
August 2, 2026 17:37
35bbb09 to
c6585c0
Compare
cixzhang
force-pushed
the
feat/component-icon-mapping
branch
from
August 2, 2026 17:51
c6585c0 to
c740262
Compare
cixzhang
force-pushed
the
feat/component-icon-mapping
branch
from
August 2, 2026 22:36
c740262 to
a6a370c
Compare
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
August 2, 2026 22:37
cixzhang
force-pushed
the
feat/component-icon-mapping
branch
from
August 3, 2026 01:54
a6a370c to
769abee
Compare
cixzhang
force-pushed
the
feat/component-icon-mapping
branch
from
August 3, 2026 02:48
769abee to
f98460b
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsIcon (@astryxdesign/core) · View in Storybook
Selector (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 1 accessibility violation(s) found — 1 serious. Icon - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Some icon choices are component semantics rather than global glyph choices. Selector is a good example: its selected-option indicator defaults to
check, but a theme may want that same purpose to render a different registry icon or no icon at all.What
Adds themeable component icon mappings on top of the theme icon registry work:
componentIconstodefineTheme()/DefinedTheme, inherited throughextends.useIcon(slot, fallback)for component internals andgetComponentIcon()/getComponentIconName()for explicit-source resolution.selector-selected-optionslot.componentIconsinastryx theme buildoutput.Risk
The default Selector selected option remains a check icon. Themes can now remap or suppress that purpose through
componentIcons; this is additive unless a theme opts in.Testing
pnpm exec vitest run --project ui packages/core/src/Icon/globalIconRegistry.test.tsx packages/core/src/Selector/Selector.test.tsx packages/core/src/theme/defineTheme.test.ts --reporter=dotpnpm exec vitest run --project node packages/cli/clients/cli/lib/component-format.test.mjs packages/cli/api/theme/build/build.test.mjs --reporter=dotpnpm -F @astryxdesign/core typecheckpnpm -F @astryxdesign/core lintpnpm -F @astryxdesign/cli typecheck:authoringpnpm check:syncpnpm check:package-boundariespnpm check:changesetspnpm -F @astryxdesign/core build