Skip to content

Commit

Permalink
implement code connect for segmentedControl
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Nov 18, 2024
1 parent 912a0d7 commit 718f3d7
Show file tree
Hide file tree
Showing 13 changed files with 4,277 additions and 1,959 deletions.
1,270 changes: 558 additions & 712 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"@babel/plugin-transform-modules-commonjs": "7.24.1",
"@babel/preset-react": "7.24.7",
"@babel/preset-typescript": "7.24.7",
"@figma/code-connect": "1.0.6",
"@figma/code-connect": "1.2.2",
"@primer/css": "^21.3.6",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "25.0.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/react/script/figma-connect-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ ${Array.from(uniqueNames)
${icons
.map(
icon => `figma.connect(${icon.name}, '${icon.figmaUrl}', {
props: {
name: "${icon.name}",
fn: ${icon.name}
},
example: () => <${icon.name} size={${icon.size}} />,
})`,
)
Expand Down
39 changes: 0 additions & 39 deletions packages/react/src/ActionBar/ActionBar.figma.tsx

This file was deleted.

39 changes: 39 additions & 0 deletions packages/react/src/ActionBar/disabled.ActionBar.Figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-nocheck
// import React from 'react'
// import {ActionBar} from '..'
// import figma from '@figma/code-connect'

// figma.connect(
// ActionBar,
// 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17042-65810&t=ARVklwnsUc0zUmot-4',
// {
// props: {
// items: figma.children(['ActionBar.IconButton', 'ActionBar.Divider']),
// },
// example: ({items}) => <ActionBar>{items}</ActionBar>,
// },
// )

// figma.connect(
// ActionBar.IconButton,
// 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=35848-26016&m=dev',
// {
// props: {
// iconButton: figma.nestedProps('IconButton', {
// icon: figma.instance('icon'),
// ariaLabel: figma.string('aria-label'),
// }),
// },
// example: ({iconButton}) => <ActionBar.IconButton icon={iconButton.icon} aria-label={iconButton.ariaLabel} />,
// },
// )

// figma.connect(
// ActionBar.Divider,
// 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17042-65808&t=ARVklwnsUc0zUmot-4',
// {
// props: {},
// example: () => <ActionBar.Divider />,
// },
// )
2 changes: 1 addition & 1 deletion packages/react/src/Banner/Banner.figma.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import React from 'react'
import {Banner} from '../../src/drafts'
import {Banner} from '../../src/experimental/'
import figma from '@figma/code-connect'

const componentProps = {
Expand Down
19 changes: 19 additions & 0 deletions packages/react/src/Heading/Heading.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react'
import Heading from './Heading'
import figma from '@figma/code-connect'

figma.connect(
Heading,
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=21069-78785&t=LhKEppN9LJfzQQ49-4',
{
props: {
text: figma.textContent('Text'),
variant: figma.enum('variant', {
large: 'large',
medium: 'medium',
small: 'small',
}),
},
example: ({text, variant}) => <Heading variant={variant}>{text}</Heading>,
},
)
Loading

0 comments on commit 718f3d7

Please sign in to comment.