Skip to content
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

fix: code connect update #17577

Merged
merged 13 commits into from
Oct 3, 2024
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 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 not shown.
Binary file not shown.
30 changes: 23 additions & 7 deletions packages/react/code-connect/CodeSnippet/CodeSnippet.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,42 @@ import figma from '@figma/code-connect';

// Inline
figma.connect(
CodeSnippet,
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=4266-104904&t=cMvnFTYLPEhzhIpj-4',
{
example: () => {
return <div>{/* To view CodeSnippet code, view inner component */}</div>;
variant: { Tooltip: 'True' },
props: {
codeSnippet: figma.nestedProps('Code snippet', {
text: figma.textContent('node -v'),
}),
tooltip: figma.nestedProps('Tooltip content', {
text: figma.textContent('Tooltip text'),
}),
},
example: ({ codeSnippet, tooltip }) => {
return (
<CodeSnippet type="inline" feedback={tooltip.text}>
{codeSnippet.text}
</CodeSnippet>
);
},
}
);

//Inline item
figma.connect(
CodeSnippet,
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=4266-104960&t=cMvnFTYLPEhzhIpj-4',
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=4266-104904&t=cMvnFTYLPEhzhIpj-4',
{
variant: { Tooltip: 'False' },
props: {
children: figma.textContent('node -v'),
codeSnippet: figma.nestedProps('Code snippet', {
text: figma.textContent('node -v'),
}),
},
example: ({ children }) => {
example: ({ codeSnippet }) => {
return (
<CodeSnippet type="inline" feedback="Copied to clipboard">
{children}
{codeSnippet.text}
</CodeSnippet>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

// @ts-nocheck
import React from 'react';
import { Form } from './FormOnPage';
import { Form } from '@carbon/react';
import figma from '@figma/code-connect';

figma.connect(
Form,
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=3897-51336&t=SbIuH3RAJeFPjXmN-4',
{
props: {
chidlren: figma.children('*'),
children: figma.children('*'),
},
example: ({ chidlren }) => <Form aria-label="sample form">{chidlren}</Form>,
example: ({ children }) => <Form aria-label="sample form">{children}</Form>,
}
);
2 changes: 1 addition & 1 deletion packages/react/code-connect/Popover/Popover.figma.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// @ts-nocheck
import React from 'react';
import { Popover, PopoverContent } from './Popover';
import { Popover, PopoverContent } from '@carbon/react';
import { Settings } from '@carbon/react';
import figma from '@figma/code-connect';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// @ts-nocheck
import React from 'react';
import { unstable__FluidTextArea as FluidTextArea } from './TextAreaFluid';
import { unstable__FluidTextArea as FluidTextArea } from '@carbon/react';
import figma from '@figma/code-connect';

figma.connect(
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@babel/preset-typescript": "^7.24.7",
"@carbon/test-utils": "^10.33.0",
"@carbon/themes": "^11.41.0",
"@figma/code-connect": "^1.0.6",
"@figma/code-connect": "^1.1.4",
"@rollup/plugin-babel": "^6.0.0",
"@rollup/plugin-commonjs": "^26.0.0",
"@rollup/plugin-node-resolve": "^15.0.0",
Expand Down
Loading
Loading