chore: Add Code Connect for Section Components - #1249
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
📖 Storybook Preview |
| SectionHeader, | ||
| 'https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-MMDS-Components?node-id=9624-8419', | ||
| { | ||
| props: { |
There was a problem hiding this comment.
I've intentionally omitted isInteractive in Figma and here because it's harder to capture dynamically in Figma.
|
Reverting to draft to accommodate #1267 |
There was a problem hiding this comment.
LGTM! Both files are correct and the layer name matching for figma.children() is verified against the Figma component structure. Two follow-up items noted below.
One for the Figma component itself: the tag variant has a flex/alignment issue where the title text renders center-aligned rather than left-aligned — visible in the component playground. Worth a design fix in the Figma file separately from this PR.
| title: figma.string('title'), | ||
| startAccessory: figma.boolean('startAccessory', { | ||
| true: figma.children('startAccessory'), | ||
| false: undefined, |
There was a problem hiding this comment.
suggestion: The Figma docs now distinguish figma.slot() from figma.children(). figma.slot() is designed for freeform content areas (any child type — icon, tag, avatar, etc.) while figma.children() targets named component instances specifically. Since startAccessory, titleAccessory, and endAccessory are freeform slots, migrating to figma.slot() would be more accurate and should improve how nested components like AvatarFavicon resolve in Dev Mode.
Example:
props: {
title: figma.string('title'),
startAccessory: figma.slot('startAccessory'),
titleAccessory: figma.slot('titleAccessory'),
endAccessory: figma.slot('endAccessory'),
},
📖 Storybook Preview |
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
Description
Adds Figma Code Connect mappings for React Native section layout components.
SectionHeader.figma.tsx
New
SectionHeader.figma.tsxfor React NativeMatched props
title→titlestartAccessory→startAccessory(nestedIconviafigma.children())titleAccessory→titleAccessory(nestedIconviafigma.children())endAccessory→endAccessory(nestedIconviafigma.children())subtitle→children(nested subtitle content viafigma.children('children')when the Figmasubtitleboolean is enabled)Intentionally omits Figma-only properties:
variant (Figma only)SectionDivider.figma.tsx
New
SectionDivider.figma.tsxfor React NativeMatched props
<SectionDivider />with component defaults (marginVertical={5},borderWidth={1},borderColor={BorderMuted})Intentionally omits Figma-only properties:
withMargin (Figma only)Related issues
Manual testing steps
childrenwhensubtitleis enabled) and omit Figma-only propertiesScreenshots/Recordings
Before
N/A
After
section-header.mov
section-divider.mov
Pre-merge author checklist
Pre-merge reviewer checklist