Skip to content

Commit 382a264

Browse files
committed
feat(CC-icon): added react peer dependency
1 parent 798f1e3 commit 382a264

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import figma from '@figma/code-connect';
2+
import { Icon } from '@patternfly/react-core';
3+
4+
figma.connect(
5+
Icon,
6+
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/branch/9QzcMKMR7FX7HXlc0sRUSp/PatternFly-6--Components?node-id=198-1573&t=dP3Et2mI3FtI6IEP-11',
7+
{
8+
props: {
9+
// Comprehensive icon size mapping
10+
size: figma.enum('Icon Size', {
11+
'Body - Small': 'bodySm',
12+
'Body - Default': 'bodyDefault',
13+
'Body - Large': 'bodyLg',
14+
15+
// Heading Sizes
16+
'Heading - H1': 'heading_3xl',
17+
'Heading - H2': 'heading_2xl',
18+
'Heading - H3': 'headingXl',
19+
'Heading - H4': 'headingLg',
20+
'Heading - H5': 'headingMd',
21+
'Heading - H6': 'headingSm'
22+
}),
23+
children: figma.instance('*')
24+
},
25+
26+
example: (props) => <Icon size={props.size}>{props.children}</Icon>
27+
}
28+
);

packages/code-connect/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"fs-extra": "^11.3.0",
66
"fse": "^4.0.1"
77
},
8+
"peerDependencies": {
9+
"react": "^17 || ^18 || ^19",
10+
"react-dom": "^17 || ^18 || ^19"
11+
},
812
"scripts": {
913
"figma:icons:fetch": "node scripts/fetchIcons.mjs --token",
1014
"figma:icons:sync": "node scripts/iconConnector.mjs"

packages/code-connect/scripts/iconConnector.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
import fs from 'fs/promises';
99
import path from 'path';
10-
import { existsSync } from 'fs';
1110

1211
// Simple logger implementation
1312
const logger = {

0 commit comments

Comments
 (0)