-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5d007f
commit 6fa7aff
Showing
65 changed files
with
1,272 additions
and
35 deletions.
There are no files selected for viewing
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,13 @@ | ||
on: | ||
push: | ||
paths: | ||
- src/packages/react/code-connect/**/*.figma.tsx | ||
branches: | ||
- main | ||
|
||
jobs: | ||
code-connect: | ||
name: Code Connect | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: npx figma connect publish |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+21.7 KB
.yarn/cache/@babel-helper-compilation-targets-npm-7.23.6-aa6f07f088-05595cd730.zip
Binary file not shown.
Binary file added
BIN
+4.31 KB
.yarn/cache/@babel-helper-environment-visitor-npm-7.22.20-260909e014-d80ee98ff6.zip
Binary file not shown.
Binary file added
BIN
+8.77 KB
.yarn/cache/@babel-helper-function-name-npm-7.23.0-ce38271242-7b2ae024cd.zip
Binary file not shown.
Binary file added
BIN
+18.2 KB
.yarn/cache/@babel-helper-module-imports-npm-7.24.3-edb733448b-42fe124130.zip
Binary file not shown.
Binary file added
BIN
+45.5 KB
.yarn/cache/@babel-helper-module-transforms-npm-7.24.5-c2288b45c7-1a91e8abc2.zip
Binary file not shown.
Binary file added
BIN
+5.91 KB
.yarn/cache/@babel-helper-simple-access-npm-7.24.5-9de60df3e9-db8768a165.zip
Binary file not shown.
Binary file added
BIN
+5.24 KB
.yarn/cache/@babel-helper-split-export-declaration-npm-7.24.5-3459ebfe18-84777b6304.zip
Binary file not shown.
Binary file added
BIN
+9.84 KB
.yarn/cache/@babel-helper-string-parser-npm-7.24.1-0a40ece7f8-04c0ede77b.zip
Binary file not shown.
Binary file added
BIN
+17.6 KB
.yarn/cache/@babel-helper-validator-identifier-npm-7.24.5-d1938535fe-38aaf6a64a.zip
Binary file not shown.
Binary file added
BIN
+7.16 KB
.yarn/cache/@babel-helper-validator-option-npm-7.23.5-d83bbfe738-537cde2330.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+23 KB
.yarn/cache/@jridgewell-gen-mapping-npm-0.3.5-d8b85ebeaf-81587b3c4d.zip
Binary file not shown.
Binary file added
BIN
+17.5 KB
.yarn/cache/@jridgewell-resolve-uri-npm-3.1.2-5bc4245992-97106439d7.zip
Binary file not shown.
Binary file added
BIN
+8.72 KB
.yarn/cache/@jridgewell-set-array-npm-1.2.1-2312928209-832e513a85.zip
Binary file not shown.
Binary file added
BIN
+14.7 KB
.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.15-a055fb62cf-89960ac087.zip
Binary file not shown.
Binary file added
BIN
+45.6 KB
.yarn/cache/@jridgewell-trace-mapping-npm-0.3.25-c076fd2279-dced32160a.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.29 KB
.yarn/cache/@storybook-client-logger-npm-7.6.19-6ae88c3561-140ea57ea5.zip
Binary file not shown.
Binary file added
BIN
+25.4 KB
.yarn/cache/@storybook-core-events-npm-7.6.19-3894c301ac-bbf856ee35.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+13.2 KB
.yarn/cache/@storybook-csf-tools-npm-7.6.19-b014c5f562-ef616c8df2.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+38.5 KB
.yarn/cache/electron-to-chromium-npm-1.4.758-b5b60956b8-b8d5bc1af5.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.75 KB
.yarn/cache/update-browserslist-db-npm-1.0.15-7a2f8a8231-6800bfac69.zip
Binary file not shown.
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,23 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Accordion } from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
figma.connect( | ||
Accordion, | ||
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=2490-17019&mode=design&t=0hF8pirV0i9mofd1-4', | ||
{ | ||
props: { children: figma.children(['Accordion item']) }, | ||
example: ({ children }) => ( | ||
// Disclaimer: Code Connect is currently in beta and | ||
// integration with Carbon React is a work in progress. | ||
<Accordion>{children}</Accordion> | ||
), | ||
} | ||
); |
71 changes: 71 additions & 0 deletions
71
packages/react/code-connect/Accordion/AccordionItem.figma.tsx
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,71 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { AccordionItem } from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
figma.connect( | ||
AccordionItem, | ||
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=2154-8478&mode=design&t=0hF8pirV0i9mofd1-4', | ||
{ | ||
props: { | ||
title: figma.string('Title text'), | ||
disabled: figma.enum('State', { | ||
Disabled: true, | ||
}), | ||
open: figma.boolean('Expanded'), | ||
content: figma.string('Content text'), | ||
children: figma.instance('Swap slot'), | ||
|
||
// Accordion props | ||
// <Accordion size={size} isFlush={isFlush} align={align}> | ||
size: figma.enum('Size', { | ||
Large: 'lg', | ||
Medium: 'md', | ||
Small: 'sm', | ||
}), | ||
isFlush: figma.boolean('Flush'), | ||
align: figma.enum('Alignment', { | ||
Left: 'start', | ||
}), | ||
}, | ||
example: ({ | ||
title, | ||
disabled, | ||
open, | ||
content, | ||
children, | ||
// size, | ||
// isFlush, | ||
// align, | ||
}) => ( | ||
<AccordionItem title={title} disabled={disabled} open={open}> | ||
{content} | ||
{children} | ||
</AccordionItem> | ||
), | ||
} | ||
); | ||
|
||
// figma.connect( | ||
// AccordionSkeleton, | ||
// 'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=14032-290635&mode=dev', | ||
// { | ||
// variant: { State: 'Skeleton' }, | ||
// props: { | ||
// open: figma.boolean('Expanded'), | ||
// isFlush: figma.boolean('Flush'), | ||
// align: figma.enum('Alignment', { | ||
// Left: 'start', | ||
// }), | ||
// }, | ||
// example: ({ size, hideLabel }) => { | ||
// return <AccordionSkeleton align={align} />; | ||
// }, | ||
// } | ||
// ); |
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,89 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Button, ButtonSkeleton } from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
figma.connect( | ||
Button, | ||
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=1854-1776&mode=dev', | ||
{ | ||
props: { | ||
disabled: figma.enum('State', { | ||
Disabled: true, | ||
}), | ||
buttonText: figma.string('Button text'), | ||
kind: figma.enum('Style', { | ||
Primary: 'primary', | ||
Secondary: 'secondary', | ||
Tertiary: 'tertiary', | ||
Ghost: 'ghost', | ||
'Danger primary': 'danger', | ||
'Danger tertiary': 'danger--tertiary', | ||
'Danger ghost': 'danger--ghost', | ||
}), | ||
size: figma.enum('Size', { | ||
Large: 'lg', | ||
Medium: 'md', | ||
Small: 'sm', | ||
'Extra large': 'xl', | ||
'2x large': '2xl', | ||
}), | ||
isExpressive: figma.enum('Size', { | ||
Expressive: true, | ||
}), | ||
hasIconOnly: figma.enum('Type', { | ||
'Icon only': true, | ||
}), | ||
renderIcon: figma.instance('Swap icon'), | ||
}, | ||
example: ({ | ||
size, | ||
kind, | ||
isExpressive, | ||
hasIconOnly, | ||
renderIcon, | ||
disabled, | ||
buttonText, | ||
}) => { | ||
return ( | ||
// Disclaimer: Code Connect is currently in beta and | ||
// integration with Carbon React is a work in progress. | ||
<Button | ||
size={size} | ||
kind={kind} | ||
isExpressive={isExpressive} | ||
hasIconOnly={hasIconOnly} | ||
renderIcon={renderIcon} | ||
disabled={disabled}> | ||
{buttonText} | ||
</Button> | ||
); | ||
}, | ||
} | ||
); | ||
|
||
figma.connect( | ||
ButtonSkeleton, | ||
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=1854-1776&mode=dev', | ||
{ | ||
variant: { State: 'Skeleton' }, | ||
props: { | ||
size: figma.enum('Size', { | ||
Large: 'lg', | ||
Medium: 'md', | ||
Small: 'sm', | ||
'Extra large': 'xl', | ||
'2x large': '2xl', | ||
}), | ||
}, | ||
example: ({ size }) => { | ||
return <ButtonSkeleton size={size} />; | ||
}, | ||
} | ||
); |
33 changes: 33 additions & 0 deletions
33
packages/react/code-connect/ContainedList/ContainedList.figma.tsx
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,33 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { ContainedList } from '@carbon/react'; | ||
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( | ||
ContainedList, | ||
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=16193-272726&mode=design&t=0PKDyr2vMtgRONHX-4', | ||
{ | ||
props: { | ||
search: figma.boolean('Search'), | ||
type: figma.enum('Type', { | ||
'On page': 'on-page', | ||
Disclosed: 'disclosed', | ||
}), | ||
}, | ||
example: () => <ContainedList />, | ||
} | ||
); |
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,59 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2024 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// React : Figma | ||
// DataTable > Table : Data table | ||
// TableSelectRow & TableRow : Data table row | ||
// TableHead > TableRow : Data table header row item | ||
// TableBody > TableRow : Data table body row item | ||
// TableCell : Data table row cell item | ||
// TableHeader : Data table header cell item | ||
|
||
import React from 'react'; | ||
import { | ||
DataTable, | ||
// Table, | ||
// TableHead, | ||
// TableRow, | ||
// TableHeader, | ||
// TableBody, | ||
// TableCell, | ||
} from '@carbon/react'; | ||
import figma from '@figma/code-connect'; | ||
|
||
figma.connect( | ||
DataTable, | ||
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=4630-268268&mode=design&t=dSt5NCwcWajIQZR7-4', | ||
{ | ||
props: { | ||
body: figma.boolean('Body'), | ||
swapslot: figma.instance('Swap slot'), | ||
slot: figma.boolean('Slot'), // shows up below data table | ||
toolbar: figma.boolean('Toolbar'), | ||
pagination: figma.boolean('Pagination'), | ||
type: figma.enum('Type', { | ||
Default: 'default', | ||
Expandable: 'expandable', | ||
'Select checkbox': 'select-checkbox', | ||
'Select radio': 'select-radio', | ||
'Expandable + Selectable': 'expandable---selectable', | ||
'Batch actions': 'batch-actions', | ||
}), | ||
size: figma.enum('Size', { | ||
'XL / LG / MD': 'xl---lg---md', | ||
'SM / XS': 'sm---xs', | ||
}), | ||
skeleton: figma.boolean('Skeleton'), | ||
}, | ||
example: () => { | ||
// Disclaimer: Code Connect is currently in beta and | ||
// integration with Carbon React is in an exploratory phase. | ||
|
||
return <DataTable></DataTable>; | ||
}, | ||
} | ||
); |
Oops, something went wrong.