This repository was archived by the owner on May 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Figma Code Connect #345
Closed
Closed
Figma Code Connect #345
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
7c9b4e2
feat: adding code connect base
calebnance 0987ec2
first go at figma.config for code connect
calebnance 6e034c4
added example files for component mapping
calebnance 10bcad1
starting to connect figma ds props with react component props
calebnance 976b342
added more mappings
calebnance 74ebd3f
fixed typos and spacing issues i found in readme
calebnance c1c68d2
added checkbox, radio, and switch
calebnance 7368608
ts-ignore for code connect files
calebnance 765b8dd
added required prop to Alert Dialog
calebnance c926b2b
fixed page notice issue
calebnance 265fe37
fixes markdown issue
calebnance f836072
added more mappings
calebnance e3f5a75
added Tourtip and Video mapping
calebnance 15bb3f6
added more components and variant overrides
calebnance 3cced0d
added section-title and signal with variants
calebnance a3c63d1
added pagination and progress-stepper
calebnance fc5b605
no longer needed
calebnance 1a227e1
updated button mappings
calebnance 5f42779
added publish/unpublish script for Figma Code Connect
calebnance acba902
Merge branch 'main' into cn-code-connect
darkwebdev fce104c
added code connect docs
calebnance 34ff1e2
updated readme
calebnance 91d6636
updated readme
calebnance be46f22
fixes the naming issues
calebnance 47ba8ff
merged latest
calebnance 91abb75
updated lint issues
calebnance cc7afe0
updated yarn
calebnance 11e1f9a
Merge branch 'main' into cn-code-connect
HenriqueLimas 3dc568f
new mappings
calebnance 956b54b
fixed section title
calebnance 561758e
updated figma file
calebnance 5eb6ee0
Merge branch 'main' into cn-code-connect
HenriqueLimas 2128a90
cleaned up figma links
calebnance c888890
Merge remote-tracking branch 'upstream/main' into cn-code-connect
calebnance c6c07c8
move into tests directories
calebnance 4c34e87
remove code connect from main readme
calebnance 1df1ebf
updated pathings
calebnance 1e823ed
replacement pathing wasn't working
calebnance 8db66d9
updated ignore list
calebnance 68154bc
upgraded package
calebnance File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ junit.xml | |
coverage | ||
/.vscode | ||
/storybook-static | ||
.env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Figma Code Connect | ||
|
||
**Publishing** | ||
|
||
``` | ||
npx figma connect publish --token <token> | ||
``` | ||
|
||
**Unpublishing** | ||
|
||
``` | ||
npx figma connect unpublish --token <token> | ||
``` | ||
|
||
**Helpful links:** | ||
|
||
- [React docs](https://github.com/figma/code-connect/blob/main/cli/README.md) | ||
- [Icon linking](https://www.figma.com/code-connect-docs/react/#connecting-icons) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"codeConnect": { | ||
"include": ["src/**/*.figma.tsx", "src/**/*.tsx"], | ||
"exclude": ["test/**", "docs/**", "build/**"], | ||
|
||
"react": { | ||
"importPaths": { | ||
"src/ebay-accordion/__tests__/*": "@ebay/ui-core-react/ebay-accordion", | ||
"src/ebay-alert-dialog/__tests__/*": "@ebay/ui-core-react/ebay-alert-dialog", | ||
"src/ebay-badge/__tests__/*": "@ebay/ui-core-react/ebay-badge", | ||
"src/ebay-breadcrumbs/__tests__/*": "@ebay/ui-core-react/ebay-breadcrumbs", | ||
"src/ebay-button/__tests__/*": "@ebay/ui-core-react/ebay-button", | ||
"src/ebay-calendar/__tests__/*": "@ebay/ui-core-react/ebay-calendar", | ||
"src/ebay-carousel/__tests__/*": "@ebay/ui-core-react/ebay-carousel", | ||
"src/ebay-icon-button/__tests__/*": "@ebay/ui-core-react/ebay-icon-button", | ||
"src/ebay-page-notice/__tests__/*": "@ebay/ui-core-react/ebay-page-notice", | ||
"src/ebay-pagination/__tests__/*": "@ebay/ui-core-react/ebay-pagination", | ||
"src/ebay-progress-stepper/__tests__/*": "@ebay/ui-core-react/ebay-progress-stepper", | ||
"src/ebay-radio/__tests__/*": "@ebay/ui-core-react/ebay-radio", | ||
"src/ebay-select/__tests__/*": "@ebay/ui-core-react/ebay-select", | ||
"src/ebay-section-title/__tests__/*": "@ebay/ui-core-react/ebay-section-title", | ||
"src/ebay-signal/__tests__/*": "@ebay/ui-core-react/ebay-signal", | ||
"src/ebay-skeleton/__tests__/*": "@ebay/ui-core-react/ebay-skeleton", | ||
"src/ebay-snackbar-dialog/__tests__/*": "@ebay/ui-core-react/ebay-snackbar-dialog", | ||
"src/ebay-switch/__tests__/*": "@ebay/ui-core-react/ebay-switch", | ||
"src/ebay-tabs/__tests__/*": "@ebay/ui-core-react/ebay-tabs", | ||
"src/ebay-textbox/__tests__/*": "@ebay/ui-core-react/ebay-textbox", | ||
"src/ebay-tooltip/__tests__/*": "@ebay/ui-core-react/ebay-tooltip", | ||
"src/ebay-tourtip/__tests__/*": "@ebay/ui-core-react/ebay-tourtip", | ||
"src/ebay-video/__tests__/*": "@ebay/ui-core-react/ebay-video" | ||
}, | ||
"paths": {} | ||
} | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import figma from '@figma/code-connect' | ||
|
||
import React from 'react' | ||
import { EbayAccordion, EbayDetails } from '..' | ||
|
||
figma.connect( | ||
EbayAccordion, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Evo-Design-System?node-id=256381-3831', | ||
{ | ||
example: () => ( | ||
<EbayAccordion> | ||
<EbayDetails text="Details summary"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore | ||
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut | ||
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim id est laborum. | ||
</EbayDetails> | ||
|
||
<EbayDetails text="Second summary"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore | ||
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut | ||
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse | ||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim id est laborum. | ||
</EbayDetails> | ||
</EbayAccordion> | ||
) | ||
} | ||
) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import figma from '@figma/code-connect' | ||
|
||
import React from 'react' | ||
import { EbayAlertDialog } from '..' | ||
/* @ts-ignore: this is only to help code connect */ | ||
import { EbayDialogHeader } from '@ebay/ui-core-react/ebay-dialog-base' | ||
|
||
figma.connect( | ||
EbayAlertDialog, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Design-System?node-id=16420-100', | ||
{ | ||
props: { | ||
Title: figma.string('Title'), | ||
Body: figma.string('Body') | ||
}, | ||
example: ({ Body, Title }) => ( | ||
<EbayAlertDialog open a11yCloseText="Close" confirmText="Confirm"> | ||
<EbayDialogHeader>{Title}</EbayDialogHeader> | ||
<p>{Body}</p> | ||
</EbayAlertDialog> | ||
) | ||
} | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import figma from '@figma/code-connect' | ||
|
||
import React from 'react' | ||
import { EbayBadge } from '..' | ||
|
||
figma.connect( | ||
EbayBadge, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Evo-Design-System?node-id=38612-44629', | ||
{ | ||
props: { | ||
number: figma.string('Number') | ||
}, | ||
example: ({ number }) => <EbayBadge number={number} /> | ||
} | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import figma from '@figma/code-connect' | ||
|
||
import React from 'react' | ||
import { EbayBreadcrumbs, EbayBreadcrumbItem } from '..' | ||
|
||
figma.connect( | ||
EbayBreadcrumbs, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Design-System?node-id=67603-81724', | ||
{ | ||
example: () => ( | ||
<EbayBreadcrumbs a11yHeadingText="Page navigation"> | ||
<EbayBreadcrumbItem href="https://ebay.com">eBay</EbayBreadcrumbItem> | ||
<EbayBreadcrumbItem href="https://ebay.com/cars">Auto Parts and Vehicles</EbayBreadcrumbItem> | ||
<EbayBreadcrumbItem>Motors Parts and Accessories</EbayBreadcrumbItem> | ||
</EbayBreadcrumbs> | ||
) | ||
} | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import figma from '@figma/code-connect' | ||
|
||
import React from 'react' | ||
import { EbayButton } from '..' | ||
|
||
// button | ||
figma.connect( | ||
EbayButton, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Evo-Design-System?node-id=65849-91206', | ||
{ | ||
props: { | ||
state: figma.enum('State', { | ||
disabled: true, | ||
enabled: false | ||
}), | ||
title: figma.string('Title'), | ||
size: figma.enum('Size', { | ||
small: 'small', | ||
large: 'large' | ||
}) | ||
}, | ||
example: ({ state, size, title }) => ( | ||
<EbayButton disabled={state} size={size} variant="standard"> | ||
{title} | ||
</EbayButton> | ||
) | ||
} | ||
) | ||
|
||
// button destructive | ||
figma.connect( | ||
EbayButton, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Evo-Design-System?node-id=260004-7740', | ||
{ | ||
props: { | ||
state: figma.enum('State', { | ||
disabled: true, | ||
enabled: false | ||
}), | ||
title: figma.string('Title'), | ||
size: figma.enum('Size', { | ||
small: 'small', | ||
large: 'large' | ||
}) | ||
}, | ||
example: ({ state, size, title }) => ( | ||
<EbayButton disabled={state} size={size} variant="destructive"> | ||
{title} | ||
</EbayButton> | ||
) | ||
} | ||
) | ||
|
||
// button branded | ||
figma.connect( | ||
EbayButton, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Design-System?node-id=129776-224141', | ||
{ | ||
props: { | ||
title: figma.string('Title'), | ||
size: figma.enum('Size', { | ||
small: 'small', | ||
large: 'large' | ||
}) | ||
}, | ||
example: ({ size, title }) => ( | ||
<EbayButton size={size}> | ||
{title} | ||
</EbayButton> | ||
) | ||
} | ||
) | ||
|
||
// button link (borderless) | ||
figma.connect( | ||
EbayButton, | ||
'https://www.figma.com/design/zEBdEhbonrBOGzZ0fXzWvM/eBay-Design-System?node-id=109500-131885', | ||
{ | ||
props: { | ||
title: figma.string('Title'), | ||
size: figma.enum('Size', { | ||
small: 'small', | ||
large: 'large' | ||
}) | ||
}, | ||
example: ({ size, title }) => ( | ||
<EbayButton size={size} borderless> | ||
{title} | ||
</EbayButton> | ||
) | ||
} | ||
) |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't have this, what is the issue of this type?