ENG-3081: Replace Chakra icons with Carbon equivalents and optimize exports#7745
ENG-3081: Replace Chakra icons with Carbon equivalents and optimize exports#7745gilluminate merged 45 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Clean, well-scoped migration. The barrel file swap (export * as Icons from "@carbon/icons-react" → curated carbon.ts) is the standout improvement — trimming 2,445 icons down to 85 is a meaningful bundle win with no functional downside.
Suggestions
Close icon size in InfoBox.tsx (line 43) — The close icon changed from boxSize={5} (20px) to size={12} (12px), which doesn't match the boxSize * 4 = px formula used everywhere else in this PR. Likely unintentional; worth double-checking visually.
Color application inconsistency — Two different patterns are used for applying Chakra color tokens to Carbon icons:
<Box as="span" color="token-name">(most files in this PR — preferred)style={{ color: "var(--chakra-colors-...)" }}(ConsentItem.tsx,GpcMessages.tsx)
The wrapper approach is more resilient. The direct CSS variable string is functional today but is a maintenance risk if Chakra's variable naming ever shifts.
Nice to Have
Redundant CarbonIconType filter in carbon.stories.tsx — export type declarations have no runtime representation so they'll never appear in Object.entries(). The value != null check is the effective guard; the key !== "CarbonIconType" clause can be dropped.
No critical issues. Size conversions are otherwise correct throughout (the boxSize * 4 formula is applied consistently), icon semantic equivalents look right, and the Box as="span" wrapper pattern for layout-bearing icons is used appropriately.
Greptile SummaryThis PR completes the Chakra-to-Carbon icon migration across
Confidence Score: 4/5
Important Files Changed
Reviews (1): Last reviewed commit: "lint fixes" | Re-trigger Greptile |
| </> | ||
| ) : ( | ||
| <Button | ||
| icon={<ArrowForwardIcon />} |
There was a problem hiding this comment.
I think I'll let this one slide. This form is likely going to get a major overhaul soon anyway.
There was a problem hiding this comment.
I poked around, visited the views that Claude had pointed out as potentially problematic and couldn't find any obvious visual regressions besides a minor size difference in one button because (some?) Carbon buttons default to 16px . Looks good otherwise, approving!
7509885 to
d9c3216
Compare
Migrate 17 Chakra icons from @chakra-ui/icons to Carbon icons (Icons.*) across ~25 files in admin-ui and fidesui. Remove all Chakra icon re-exports from fidesui/src/index.ts. Delete the icon-migration POC page and its nav entry since the migration is complete. Icons with Chakra style props (boxSize, mr, color, alignSelf, etc.) are wrapped in Box spans to preserve layout behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace `export * as Icons from "@carbon/icons-react"` (2,445 icons)
with a curated barrel file exporting only the 83 icons actually used.
Update internal fidesui imports to use the barrel instead of importing
directly from @carbon/icons-react.
No consumer API changes - `import { Icons } from "fidesui"` works
identically. Unused icons now produce compile errors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Renders all 85 exported Carbon icons in a grid with a search filter. Groups both icon stories under General/Icons in the Storybook sidebar (Carbon Icons and Custom Icons). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Found by code review: List.Item.stories.tsx uses Icons.Star and Icons.Share which were not in the curated barrel file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ChakraExternalLinkIcon and ChakraWarningTwoIcon with Carbon equivalents in the privacy-center client, which was missed in the initial admin-ui sweep. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix close icon size in InfoBox (12px → 20px) to match original - Use Box wrapper with Chakra token instead of raw CSS var in ConsentItem - Remove redundant CarbonIconType filter in stories Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use Box wrapper with Chakra token instead of raw CSS var in GpcMessages - Replace Tailwind className with Chakra mx prop in ConsentItem Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2c0c566 to
191d882
Compare
These icons are used in MainSideNav.tsx for the nav collapse toggle but were missing from the curated carbon.ts export list introduced in #7745, causing typecheck failures in the merge queue. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Ticket ENG-3081
Description Of Changes
Complete the Chakra-to-Carbon icon migration by replacing all 17 remaining Chakra icon imports with Carbon equivalents across ~25 files, removing the Chakra icon re-exports from fidesui, and optimizing the Carbon icon exports with a curated barrel file.
Code Changes
@chakra-ui/iconsusage withIcons.*from Carbon across admin-ui and fidesui's internalCheckboxItemcomponent. Icons with Chakra style props (boxSize,mr,color,alignSelf, etc.) are wrapped inBoxspans to preserve layout behavior.@chakra-ui/iconsre-export block fromfidesui/src/index.ts(22 icon aliases +createChakraIcon)fidesui/src/icons/carbon.tsbarrel file that explicitly exports only the 85 Carbon icons actually used, replacingexport * as Icons from "@carbon/icons-react"(2,445 icons)@carbon/icons-reactGeneral/Icons/Carbon IconsGeneral/Icons/Custom Iconsto group with Carbon IconsSteps to Confirm
General > Icons > Carbon Iconsto see the filterable gallery of all 85 exported iconsGeneral > Icons > Custom Iconsstill renders the 5 custom SVG icons@chakra-ui/iconsimports remain in admin-ui (onlyAccordionIcon,AlertIcon,ListIconfrom@chakra-ui/reactremain, which are Chakra component icons out of scope)Pre-Merge Checklist
CHANGELOG.mdupdated