feat: Update Switch Code Connect with proper Figma mappings#9
Open
beaucalvez wants to merge 2 commits intomainfrom
Open
feat: Update Switch Code Connect with proper Figma mappings#9beaucalvez wants to merge 2 commits intomainfrom
beaucalvez wants to merge 2 commits intomainfrom
Conversation
- Fix Radio.figma.tsx to remove value and name props (not in Figma component) - Update figma.config.json to include all .tsx files for proper import resolution - Add figma-publish.sh script to properly load .env.local token - Update package.json to use shell script for figma:publish command - Successfully published 41 Code Connect components to Figma The Code Connect setup now works correctly with npm run figma:publish and properly maps all component properties from Figma to React code. Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix import from @mantine/core to ./Switch (local DS component) - Add all size variants (xs, sm, md, lg, xl) - Map label, checked, onLabel, and offLabel properties from Figma - Use conditional spread to omit empty onLabel/offLabel props - Update node-id to point to correct Figma component The Code Connect now properly generates clean Switch code with optional inner labels only when they have values. Co-authored-by: Cursor <cursoragent@cursor.com>
posabsolute
approved these changes
Feb 16, 2026
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.
Summary
What Changed
@mantine/coreto./Switch(local DS component)label,checked,onLabel,offLabelfrom FigmaonLabel/offLabelwhen they have valuesCode Optimization
Uses conditional spread operators to omit empty props:
When
onLabel=""andoffLabel="", the generated code is:When
onLabel="ON"andoffLabel="OFF", the generated code is:Test Plan
Made with Cursor