-
Notifications
You must be signed in to change notification settings - Fork 60
[docs] Add code connect files #2286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
j-mnizhek
wants to merge
79
commits into
release/v16
Choose a base branch
from
figma-code-connect-files
base: release/v16
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,933
−92
Draft
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
66a9eb4
[docs] add code connect for Tooltip
j-mnizhek 5a9ece7
[docs] remove typo
j-mnizhek 3cf6dbc
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek a6bae79
[docs] add DescriptionTooltip mappings
j-mnizhek f6a7f70
[docs] add files for Button and Tag
j-mnizhek 7982442
[docs] remove ReactFragment leftovers
j-mnizhek 13f0877
[docs] update tag for Tooltip and Hint code connect files
j-mnizhek b32bd1e
[docs] update tag for Tooltip and Hint code connect files
j-mnizhek 08ecdbf
[docs] destructured props
j-mnizhek 3e5bd8c
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek e27c94b
[docs] fix typo
j-mnizhek fe026fe
[docs] fix typo
j-mnizhek 9e327ea
[docs] add file for Link
j-mnizhek 6b9025c
[docs] update Button and Link mappings
j-mnizhek a979d58
[docs] add mappings for Checkbox and Radio
j-mnizhek 1c695a3
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek aba80de
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek 5699ded
[docs] pills, badge, divider connect
sheila-semrush 55c4f20
[docs] update code connect files
j-mnizhek b185904
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek 4d9924b
[docs] fix typos >_<
j-mnizhek 50f06ab
[docs] add label to Badge
j-mnizhek 4b08c76
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek 3d3f3a1
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek ece4f5b
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek fa0a95b
Delete figma/InputNumber.figma.tsx
j-mnizhek 605a1fd
[docs] update code connect files
j-mnizhek 15e5ed8
Revert "Delete figma/InputNumber.figma.tsx"
j-mnizhek 430fe9a
[docs] remove files
j-mnizhek 9d52662
[chore] updated figma.config.json file
slizhevskyv-semrush 7f88ecc
[docs] update names for addons
j-mnizhek f00beff
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek fd89b7f
[docs] update connect files
j-mnizhek 5b010f9
[docs] update Select mappings
j-mnizhek 592918e
[docs] add all mappings for Select components
j-mnizhek 97a9a1a
[docs] update all mappings for Input components
j-mnizhek f5a4409
[docs] add mapping for Dot
j-mnizhek 59e85c4
Merge branch 'release/v16' into figma-code-connect-files
j-mnizhek 08cddd4
[docs] add mappings for a bunch of components
j-mnizhek e4d3fd8
[docs] add more skeleton mappings
j-mnizhek 402dacb
[docs] add mappings for List components
j-mnizhek 778fb1b
[docs] add mappings for List components
j-mnizhek 3f5e7a8
[docs] add new mappings
j-mnizhek 2b09003
[docs] update mappings
j-mnizhek 0450c6c
[docs] divide Skeleton mappings into several files
j-mnizhek b9ecbb3
Merge branch 'release/v16' into figma-code-connect-files
sheila-semrush 495c10c
[docs] renamed tsx files to jsx
sheila-semrush f2e3241
Merge branch 'release/v16' into figma-code-connect-files
sheila-semrush f7e4ecf
[docs] connected icons, list, updated inputNumber
sheila-semrush 2d8380d
[chore] figma token in dotenv
sheila-semrush 55bb754
[docs] fixed imports
sheila-semrush bf38c95
[chore] renamed figma token
sheila-semrush 504acbf
[docs] update List mappings
j-mnizhek 6dbbde5
[docs] update Spin mappings
j-mnizhek 6e861a6
[docs] update imports
j-mnizhek 4b41f35
Merge branch 'release/v16' into figma-code-connect-files
sheila-semrush 5d84fd2
[chore] revert some accidental changes
sheila-semrush 4006352
[chore] fixed figma config and removed unnecessary data, upload old e…
sheila-semrush c4f7522
[chore] added custom parser and figma as dev dependency
sheila-semrush e9ef5e5
[chore] fix lockfile
sheila-semrush 566211a
[chore] Merge remote-tracking branch 'github/release/v16' into figma-…
sheila-semrush 0446d5d
[chore] fix lockfile
sheila-semrush bc94cf0
[docs] add react import to InputNumber
j-mnizhek 3e38f3f
[docs] add and fix a bunch of mappings
j-mnizhek aad712f
[docs] update mappings
j-mnizhek 40dda1f
[docs] fix typo
j-mnizhek 5187aa3
[docs] clarification about component id
sheila-semrush 51c163c
[docs] Pagination
sheila-semrush c2195b9
[chore] custom parser improvements
sheila-semrush abf027c
[docs] updated icon only button
sheila-semrush aa6310a
[docs] update and add new mappings
j-mnizhek efdbf01
[docs] connect TimePicker
sheila-semrush a258b91
[docs] small TimePicker fix
sheila-semrush aa899a7
[docs] small TimePicker fix
sheila-semrush cc14396
[docs] add NoticeBubble mappings
j-mnizhek 9984919
[docs] add new mappings
j-mnizhek 1d1bcc0
[docs] date-picker
sheila-semrush c7dc0fa
[chore] Merge remote-tracking branch 'github/release/v16' into figma-…
sheila-semrush 348492e
[docs] card header
sheila-semrush 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
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,12 @@ | ||
| { | ||
| "codeConnect": { | ||
| "include": ["figma/*.figma.template.js"], | ||
| "exclude": ["Example.figma.template.js"], | ||
| "label": "React", | ||
| "parser": "custom", | ||
| "parserCommand": "pnpm tsm figma/utils/parser.ts", | ||
| "paths": { | ||
| "@semcore/ui/*": ["semcore/*/src"] | ||
| } | ||
| } | ||
| } |
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,10 @@ | ||
| { | ||
| "codeConnect": { | ||
| "include": ["figma/*.figma.jsx"], | ||
| "label": "React", | ||
| "paths": { | ||
| "@semcore/ui/*": ["semcore/*/src"] | ||
| }, | ||
| "interactiveSetupFigmaFileUrl": "https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring--%E2%9D%96-Core-Components" | ||
| } | ||
| } |
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,24 @@ | ||
| import figma from '@figma/code-connect/react'; | ||
| import Badge from '@semcore/ui/badge'; | ||
|
|
||
| figma.connect( | ||
| Badge, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/%E2%9D%96-Core-Components-(Refactoring)?node-id=10059-44175&t=hkjybGSILqRb6bQU-4', | ||
| { | ||
| props: { | ||
| label: figma.textContent('↳ text'), | ||
| bg: figma.enum('type', { | ||
| '🔵 admin': figma.boolean('invert', { false: 'blue-400', true: 'white' }), | ||
| '🔴 alpha': figma.boolean('invert', { false: 'red-400', true: 'white' }), | ||
| '🟠 beta': figma.boolean('invert', { false: 'orange-400', true: 'white' }), | ||
| '🟢 new': figma.boolean('invert', { false: 'green-400', true: 'white' }), | ||
| '🟣 for you': figma.boolean('invert', { false: 'violet-400', true: 'white' }), | ||
| '⚫️ soon': figma.boolean('invert', { false: 'gray-400', true: 'white' }), | ||
| }), | ||
| color: figma.boolean('invert', { | ||
| true: 'text-primary', | ||
| }), | ||
| }, | ||
| example: (props) => <Badge {...props}>{props.label}</Badge>, | ||
| }, | ||
| ); |
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,123 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { LinkTrigger } from '@semcore/ui/base-trigger'; | ||
| import Select from '@semcore/ui/select'; | ||
|
|
||
| figma.connect( | ||
| LinkTrigger, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=10733-114376&t=TXEgCxM6iJO0FYiJ-11', | ||
| { | ||
| variant: { '← addon': 'false', 'addon →': 'false', 'icon only': 'false' }, | ||
| props: { | ||
| size: figma.enum('size', { | ||
| M: 'm', | ||
| L: 'l', | ||
| }), | ||
| placeholder: figma.textContent('↳ text'), | ||
| state: figma.enum('state', { | ||
| active: 'active', | ||
| invalid: 'invalid', | ||
| valid: 'valid', | ||
| }), | ||
| disabled: figma.enum('state', { | ||
| disabled: true, | ||
| }), | ||
| loading: figma.boolean('loading'), | ||
| }, | ||
| example: (props) => <Select tag={LinkTrigger} options={/* options */} {...props} />, | ||
| }, | ||
| ); | ||
|
|
||
| figma.connect( | ||
| LinkTrigger, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=10733-114376&t=TXEgCxM6iJO0FYiJ-11', | ||
| { | ||
| variant: { 'icon only': 'false' }, | ||
| props: { | ||
| size: figma.enum('size', { | ||
| M: 'm', | ||
| L: 'l', | ||
| }), | ||
| addonLeft: figma.enum('icon only', { | ||
| false: figma.boolean('← addon', { | ||
| true: <Select.Trigger.Addon>{/* addon */}</Select.Trigger.Addon>, | ||
| }), | ||
| }), | ||
| addonRight: figma.enum('icon only', { | ||
| false: figma.boolean('addon →', { | ||
| true: <Select.Trigger.Addon>{/* addon */}</Select.Trigger.Addon>, | ||
| }), | ||
| }), | ||
|
|
||
| content: figma.enum('icon only', { | ||
| false: figma.boolean('← addon', { | ||
| true: <Select.Trigger.Text>{/* text */}</Select.Trigger.Text>, | ||
| false: figma.boolean('addon →', { | ||
| true: <Select.Trigger.Text>{/* text */}</Select.Trigger.Text>, | ||
| false: '{/* text */}', | ||
| }), | ||
| }), | ||
| }), | ||
| text: figma.textContent('↳ text'), | ||
| state: figma.enum('state', { | ||
| active: 'active', | ||
| invalid: 'invalid', | ||
| valid: 'valid', | ||
| }), | ||
| disabled: figma.enum('state', { | ||
| disabled: true, | ||
| }), | ||
| loading: figma.boolean('loading'), | ||
| }, | ||
| example: ({ size, addonLeft, addonRight, content, state, loading, disabled }) => { | ||
| <Select tag={LinkTrigger} options={/* options */} size={size} state={state} loading={loading} disabled={disabled}> | ||
| <Select.Trigger> | ||
| {addonLeft} | ||
| {content} | ||
| {addonRight} | ||
| </Select.Trigger> | ||
| <Select.Menu hMax={/* value */}> | ||
| <Select.Option key={/* value */} value={/* value */}> | ||
| {/* option */} | ||
| </Select.Option> | ||
| </Select.Menu> | ||
| </Select>; | ||
| }, | ||
| }, | ||
| ); | ||
|
|
||
| figma.connect( | ||
| LinkTrigger, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=10733-114376&t=TXEgCxM6iJO0FYiJ-11', | ||
| { | ||
| variant: { 'icon only': 'true' }, | ||
| props: { | ||
| size: figma.enum('size', { | ||
| M: 'm', | ||
| L: 'l', | ||
| }), | ||
| addonLeft: figma.children('← - - addon properties'), | ||
| state: figma.enum('state', { | ||
| active: 'active', | ||
| invalid: 'invalid', | ||
| valid: 'valid', | ||
| }), | ||
| disabled: figma.enum('state', { | ||
| disabled: true, | ||
| }), | ||
| loading: figma.boolean('loading'), | ||
| title: figma.textContent('↳ title'), | ||
| }, | ||
| example: ({ size, addonLeft, state, loading, disabled, title }) => ( | ||
| <Select tag={LinkTrigger} options={/* options */} size={size} state={state} loading={loading} disabled={disabled} aria-label={title}> | ||
| <Select.Trigger> | ||
| <Select.Trigger.Addon>{addonLeft}</Select.Trigger.Addon> | ||
| </Select.Trigger> | ||
| <Select.Menu hMax={/* value */}> | ||
| <Select.Option key={/* value */} value={/* value */}> | ||
| {/* option */} | ||
| </Select.Option> | ||
| </Select.Menu> | ||
| </Select> | ||
| ), | ||
| }, | ||
| ); |
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,50 @@ | ||
| import figma from '@figma/code-connect/react'; | ||
| import Breadcrumbs from '@semcore/ui/breadcrumbs'; | ||
|
|
||
| figma.connect( | ||
| Breadcrumbs, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=11878-115146&t=Q0bSsRErIQ7IEZAU-11', | ||
| { | ||
| variant: { 'folder': 'true' }, | ||
| props: { | ||
| homeLink: figma.nestedProps('Home link', { | ||
| label: figma.textContent('↳ text'), | ||
| }), | ||
| folderLink: figma.nestedProps('Folder link', { | ||
| label: figma.textContent('↳ text'), | ||
| }), | ||
| productLink: figma.nestedProps('Product link', { | ||
| label: figma.textContent('↳ text'), | ||
| }), | ||
| }, | ||
| example: ({ homeLink, folderLink, productLink }) => ( | ||
| <Breadcrumbs> | ||
| <Breadcrumbs.Item href='#'>{homeLink.label}</Breadcrumbs.Item> | ||
| <Breadcrumbs.Item href='#'>{folderLink.label}</Breadcrumbs.Item> | ||
| <Breadcrumbs.Item href='#' active>{productLink.label}</Breadcrumbs.Item> | ||
| </Breadcrumbs> | ||
| ), | ||
| }, | ||
| ); | ||
|
|
||
| figma.connect( | ||
| Breadcrumbs, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=11878-115146&t=Q0bSsRErIQ7IEZAU-11', | ||
| { | ||
| variant: { 'folder': 'false' }, | ||
| props: { | ||
| homeLink: figma.nestedProps('Home link', { | ||
| label: figma.textContent('↳ text'), | ||
| }), | ||
| productLink: figma.nestedProps('Product link', { | ||
| label: figma.textContent('↳ text'), | ||
| }), | ||
| }, | ||
| example: ({ homeLink, productLink }) => ( | ||
| <Breadcrumbs> | ||
| <Breadcrumbs.Item href='#'>{homeLink.label}</Breadcrumbs.Item> | ||
| <Breadcrumbs.Item href='#' active>{productLink.label}</Breadcrumbs.Item> | ||
| </Breadcrumbs> | ||
| ), | ||
| }, | ||
| ); |
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,134 @@ | ||
| import figma from '@figma/code-connect/react'; | ||
| import Button from '@semcore/ui/button'; | ||
| import { Text } from '@semcore/ui/typography'; | ||
|
|
||
| // Need to add a variant for cases when dot is enabled | ||
|
|
||
| figma.connect( | ||
| Button, | ||
| 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=10043-43724&t=nVbIFrY5EvgteOqk-11', | ||
| { | ||
| variant: { 'icon only': 'false' }, | ||
| props: { | ||
| size: figma.enum('size', { | ||
| L: 'l', | ||
| M: 'm', | ||
| }), | ||
| use: figma.enum('use', { | ||
| primary: 'primary', | ||
| secondary: 'secondary', | ||
| tertiary: 'tertiary', | ||
| }), | ||
| theme: figma.enum('theme', { | ||
| '🔵 info': 'info', | ||
| '🟢 success': 'success', | ||
| '🔴 danger': 'danger', | ||
| '⚫️ muted': 'muted', | ||
| '⚪️ invert': 'invert', | ||
| }), | ||
| active: figma.enum('state', { | ||
| active: true, | ||
| }), | ||
| loading: figma.boolean('loading'), | ||
| disabled: figma.enum('state', { | ||
| disabled: true, | ||
| }), | ||
|
|
||
| // Cannot be used with the current structure. | ||
| // These mappings show instances and text content, but they are not working with conditional rendering for now. So I'm leaving them for possible future updates from Code Connect. | ||
| // label: figma.textContent('↳ text'), | ||
| // labelAddon: figma.textContent('↳ textAddon'), | ||
|
|
||
| // addonLeft: figma.boolean('← addon', { | ||
| // true: figma.instance('← - - - addon'), | ||
| // false: undefined, | ||
| // }), | ||
|
|
||
| // addonRight: figma.boolean('addon →', { | ||
| // true: figma.instance('addon properties - - →'), | ||
| // false: undefined, | ||
| // }), | ||
|
|
||
| // addonLeft: figma.boolean('← addon', { | ||
| // true: <Button.Addon>{/* addon */}</Button.Addon>, | ||
| // }), | ||
|
|
||
| // addonRight: figma.boolean('addon →', { | ||
| // true: <Button.Addon>{/* addon */}</Button.Addon>, | ||
| // }), | ||
|
|
||
| addonLeft: figma.enum('icon only', { | ||
| false: figma.boolean('← addon', { | ||
| true: <Button.Addon>{/* addon */}</Button.Addon>, | ||
| }), | ||
| }), | ||
| addonRight: figma.enum('icon only', { | ||
| false: figma.boolean('addon →', { | ||
| true: <Button.Addon>{/* addon */}</Button.Addon>, | ||
| }), | ||
| }), | ||
|
|
||
| content: figma.enum('icon only', { | ||
| false: figma.boolean('← addon', { | ||
| true: <Button.Text>{/* button label */}</Button.Text>, | ||
| false: figma.boolean('addon →', { | ||
| true: <Button.Text>{/* button label */}</Button.Text>, | ||
| false: '{/* button label */}', | ||
| }), | ||
| }), | ||
| }), | ||
|
|
||
| // For now, textAddon shows placeholder. Need to figure out how to show value from labelAddon here, and how to expand the component. | ||
| textAddon: figma.boolean('textAddon →', { | ||
| true: <Button.Addon><Text color='/* text-color-token */'>{/* text addon */}</Text></Button.Addon>, | ||
| }), | ||
| }, | ||
|
|
||
| example: ({ size, use, theme, disabled, active, loading, addonLeft, content, textAddon, addonRight }) => ( | ||
| <Button | ||
| size={size} | ||
| use={use} | ||
| theme={theme} | ||
| disabled={disabled} | ||
| active={active} | ||
| loading={loading} | ||
| > | ||
| {addonLeft} | ||
| {content} | ||
| {textAddon} | ||
| {addonRight} | ||
| </Button> | ||
| ), | ||
| }, | ||
| ); | ||
|
|
||
| figma.connect(Button, 'https://www.figma.com/design/RLic9ruqNNm6qgARKFk5Ae/-Refactoring-WIP--%E2%9D%96-Core-Components?node-id=10043-43724&t=nVbIFrY5EvgteOqk-11', { | ||
| variant: { 'icon only': 'true' }, | ||
| props: { | ||
| size: figma.enum('size', { | ||
| L: 'l', | ||
| }), | ||
| use: figma.enum('use', { | ||
| primary: 'primary', | ||
| tertiary: 'tertiary', | ||
| }), | ||
| theme: figma.enum('theme', { | ||
| '🔵 info': 'info', | ||
| '�� success': 'success', | ||
| '🔴 danger': 'danger', | ||
| '⚫️ muted': 'muted', | ||
| '⚪️ invert': 'invert', | ||
| }), | ||
| active: figma.enum('state', { | ||
| active: true, | ||
| }), | ||
| loading: figma.boolean('loading'), | ||
| disabled: figma.enum('state', { | ||
| disabled: true, | ||
| }), | ||
| title: figma.textContent('↳ title'), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed addon because it was rendered incorrectly |
||
| }, | ||
| example: (props) => ( | ||
| <Button {...props} addonLeft={/* icon name */} /> | ||
| ), | ||
| }); | ||
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.
I think we can omit default props (size m and secondary use)