-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working * add code connect * disable failing eslint * chore: fix TypeScript errors * Revert "chore: fix TypeScript errors" This reverts commit 0cdec4b. * trying to fix ts issues * fixes * readonly -> readOnly * disable type checking until the compinent is fixed --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
- Loading branch information
1 parent
823d2ac
commit 89c3a08
Showing
20 changed files
with
915 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{ | ||
"codeConnect": { | ||
"parser": "react", | ||
"importPaths": { | ||
"src/*": "@primer/react", | ||
"src/drafts/*": "@primer/react/drafts", | ||
"src/experimental/*": "@primer/react/experimental", | ||
"src/deprecated/*": "@primer/react/deprecated" | ||
}, | ||
"include": ["src/**/*.figma.tsx", "src/**/*.tsx"], | ||
"exclude": ["test/**", "docs/**", "build/**"], | ||
"react": { | ||
"importPaths": { | ||
"./src/*": "@primer/react" | ||
}, | ||
"paths": {} | ||
} | ||
"exclude": ["test/**", "docs/**", "build/**"] | ||
} | ||
} | ||
} |
This file contains 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 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 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 React from 'react' | ||
import {AvatarPair} from '../../src' | ||
import figma from '@figma/code-connect' | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect(AvatarPair, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=13006-42855', { | ||
props: { | ||
children: figma.children('*'), | ||
}, | ||
example: ({children}) => <AvatarPair>{children}</AvatarPair>, | ||
}) |
This file contains 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,22 @@ | ||
import React from 'react' | ||
import {AvatarStack} from '../../src' | ||
import figma from '@figma/code-connect' | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect( | ||
AvatarStack, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=3805-24&t=eMfIgDUcIkVQzl79-4', | ||
{ | ||
props: { | ||
children: figma.children('*'), | ||
}, | ||
example: ({children}) => <AvatarStack>{children}</AvatarStack>, | ||
}, | ||
) |
This file contains 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 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,48 @@ | ||
import React from 'react' | ||
import Breadcrumbs from './Breadcrumbs' | ||
import figma from '@figma/code-connect' | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect( | ||
Breadcrumbs, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?m=auto&node-id=20135-70690&t=39jWyeflbJqVh77d-1', | ||
{ | ||
props: { | ||
children: figma.children([ | ||
'1st parent', | ||
'2nd parent', | ||
'3rd parent', | ||
'4th parent', | ||
'5th parent', | ||
'6th parent', | ||
'7th parent', | ||
'8th parent', | ||
'9th parent', | ||
'Current page', | ||
]), | ||
}, | ||
example: ({children}) => <Breadcrumbs>{children}</Breadcrumbs>, | ||
}, | ||
) | ||
|
||
/** | ||
* BreadcrumbsItem | ||
*/ | ||
figma.connect(Breadcrumbs.Item, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=34258-144883', { | ||
props: { | ||
selected: figma.boolean('selected'), | ||
label: figma.textContent('label'), | ||
}, | ||
example: ({selected, label}) => ( | ||
<Breadcrumbs.Item href="#" selected={selected}> | ||
{label} | ||
</Breadcrumbs.Item> | ||
), | ||
}) |
This file contains 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 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,40 @@ | ||
import React from 'react' | ||
import {FormControl, Checkbox} from '../../src' | ||
import figma from '@figma/code-connect' | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect( | ||
Checkbox, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341-46321&t=9imbqLYmermiHP7U-4', | ||
{ | ||
props: { | ||
caption: figma.boolean('caption?', { | ||
false: undefined, | ||
true: figma.children('Caption'), | ||
}), | ||
label: figma.children('Label'), | ||
labelProps: figma.nestedProps('Label', { | ||
required: figma.boolean('required'), | ||
}), | ||
disabled: figma.enum('state', { | ||
disabled: true, | ||
}), | ||
checked: figma.boolean('checked?'), | ||
indeterminate: figma.boolean('indeterminate?'), | ||
}, | ||
example: ({disabled, label, caption, checked, indeterminate, labelProps}) => ( | ||
<FormControl disabled={disabled} required={labelProps.required}> | ||
<Checkbox checked={checked} indeterminate={indeterminate} value="..." /> | ||
{label} | ||
{caption} | ||
</FormControl> | ||
), | ||
}, | ||
) |
This file contains 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,26 @@ | ||
import React from 'react' | ||
import {CounterLabel} from '../../src' | ||
import figma from '@figma/code-connect' | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect( | ||
CounterLabel, | ||
'https://www.figma.c1om/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=18959-64970&t=9imbqLYmermiHP7U-4', | ||
{ | ||
props: { | ||
variant: figma.enum('variant', { | ||
primary: 'primary', | ||
secondary: 'secondary', | ||
}), | ||
count: figma.textContent('text'), | ||
}, | ||
example: ({variant, count}) => <CounterLabel scheme={variant}>{count}</CounterLabel>, | ||
}, | ||
) |
This file contains 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,44 @@ | ||
import React from 'react' | ||
import figma from '@figma/code-connect' | ||
import FormControl from '../FormControl' | ||
|
||
/* eslint eslint-comments/no-use: off */ | ||
/* eslint-disable primer-react/direct-slot-children */ | ||
|
||
figma.connect( | ||
FormControl.Label, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=34462-69137&t=WXa19NDaeGGhlbLq-4', | ||
{ | ||
props: { | ||
label: figma.textContent('Label'), | ||
}, | ||
example: ({label}) => <FormControl.Label>{label}</FormControl.Label>, | ||
}, | ||
) | ||
|
||
figma.connect( | ||
FormControl.Caption, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=15341-47232&t=nIetmFV1SCcA8FZ2-4', | ||
{ | ||
props: { | ||
caption: figma.textContent('Caption'), | ||
}, | ||
example: ({caption}) => <FormControl.Caption>{caption}</FormControl.Caption>, | ||
}, | ||
) | ||
/* eslint-enable primer-react/direct-slot-children */ | ||
|
||
figma.connect( | ||
FormControl.Validation, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=34428-2171&t=gvEqrj5KNY2nbDQs-4', | ||
{ | ||
props: { | ||
text: figma.textContent('text'), | ||
variant: figma.enum('variant', { | ||
error: 'error', | ||
success: 'success', | ||
}), | ||
}, | ||
example: ({text, variant}) => <FormControl.Validation variant={variant}>{text}</FormControl.Validation>, | ||
}, | ||
) |
This file contains 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 React from 'react' | ||
import figma from '@figma/code-connect' | ||
import {InlineMessage} from './InlineMessage' | ||
|
||
figma.connect(InlineMessage, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=32109-348&m=dev', { | ||
props: { | ||
variant: figma.enum('variant', { | ||
success: 'success', | ||
warning: 'warning', | ||
critical: 'critical', | ||
unavailable: 'unavailable', | ||
}), | ||
size: figma.enum('size', { | ||
small: 'small', | ||
medium: 'medium', | ||
}), | ||
text: figma.string('text'), | ||
}, | ||
example: ({size, variant, text}) => ( | ||
<InlineMessage size={size} variant={variant}> | ||
{text} | ||
</InlineMessage> | ||
), | ||
}) |
This file contains 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,46 @@ | ||
import React from 'react' | ||
import {Pagination} from '../../src' | ||
import figma from '@figma/code-connect' | ||
|
||
/** | ||
* -- This file was auto-generated by `figma connect create` -- | ||
* `props` includes a mapping from Figma properties and variants to | ||
* suggested values. You should update this to match the props of your | ||
* code component, and update the `example` function to return the | ||
* code example you'd like to see in Figma | ||
*/ | ||
|
||
figma.connect(Pagination, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=34607-94621', { | ||
props: { | ||
showPages: figma.boolean('showPages'), | ||
pages: figma.nestedProps('Pages', { | ||
currentPage: figma.enum('CurrentPage', { | ||
'1': 1, | ||
'2': 2, | ||
'3': 3, | ||
'4': 4, | ||
'5': 5, | ||
'6': 6, | ||
'7': 7, | ||
'8': 8, | ||
'9': 9, | ||
'10': 10, | ||
}), | ||
pageCount: figma.enum('PageCount', { | ||
'1': 1, | ||
'2': 2, | ||
'3': 3, | ||
'4': 4, | ||
'5': 5, | ||
'6': 6, | ||
'7': 7, | ||
'8': 8, | ||
'9': 9, | ||
'10': 10, | ||
}), | ||
}), | ||
}, | ||
example: ({showPages, pages}) => ( | ||
<Pagination showPages={showPages} pageCount={pages.pageCount} currentPage={pages.currentPage} /> | ||
), | ||
}) |
Oops, something went wrong.