Skip to content

Commit e29fe06

Browse files
committed
feat(code-connect-urls)
1 parent 06f0914 commit e29fe06

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

packages/react-core/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/deprecated
33
/components
44
/layouts
5-
/helpers
5+
/helpers
6+
yarn.lock
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react"
2+
import { AboutModal } from "./AboutModal"
3+
import figma from "@figma/code-connect"
4+
5+
/**
6+
* -- This file was auto-generated by Code Connect --
7+
* `props` includes a mapping from Figma properties and variants to
8+
* suggested values. You should update this to match the props of your
9+
* code component, and update the `example` function to return the
10+
* code example you'd like to see in Figma
11+
*/
12+
13+
figma.connect(
14+
AboutModal,
15+
"[object Object]2879-13973",
16+
{
17+
props: {
18+
productName: figma.string("Product name"),
19+
},
20+
example: (props) => <AboutModal />,
21+
},
22+
)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"figmaBaseUrl": "https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/branch/H3LonYnwH26v9zNEa2SXFk/PatternFly-6%3A-Components",
3+
"defaultNodeId": "1-196"
4+
}

packages/react-core/figma.config.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"codeConnect": {
3+
"parser": "react",
4+
"label": "PF-React",
5+
"include": [
6+
"components/*.tsx",
7+
"icons/generated/*.tsx",
8+
"icons/**/*.tsx",
9+
"icons/*.tsx",
10+
"icons/IconWrapper.figma.tsx",
11+
"icons/icons.figma.tsx"
12+
],
13+
"paths": {
14+
"../generated": ["icons/generated"],
15+
"../src/components/Icon": ["src/components/Icon"]
16+
},
17+
"aliases": {
18+
"@patternfly/react-core": "."
19+
},
20+
"options": {
21+
"instanceSwapper": {
22+
"enabled": true
23+
},
24+
"development": {
25+
"enabled": true,
26+
"verbose": true
27+
},
28+
"production": {
29+
"enabled": false
30+
}
31+
}
32+
}
33+
}

packages/react-core/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
"build:single:packages": "node ../../scripts/build-single-packages.mjs --config single-packages.config.json",
4444
"clean": "rimraf dist components layouts helpers next deprecated",
4545
"generate": "node scripts/copyStyles.mjs",
46-
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json"
46+
"subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json",
47+
"figma:watchUrls": "node codeConnect/scripts/figma-url-watcher.mjs",
48+
"figma:fixUrls": "node codeConnect/scripts/figma-url-fixer.mjs"
4749
},
4850
"dependencies": {
4951
"@patternfly/react-icons": "workspace:^",

0 commit comments

Comments
 (0)