Skip to content

Commit

Permalink
fix: code connect update (#17577)
Browse files Browse the repository at this point in the history
* fix(code-connect): small fixes and latest version bump

* chore: cleanup code comments

* fix: code snippet code connect

* chore: update text

* fix: spelling

* fix: form code connect

* fix: imports and upgrade version

* chore: yarn dedupe
  • Loading branch information
alisonjoseph authored Oct 3, 2024
1 parent 5d33c81 commit 033427b
Show file tree
Hide file tree
Showing 34 changed files with 239 additions and 38 deletions.
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

0 comments on commit 033427b

Please sign in to comment.