Skip to content

Commit 9e4b7e6

Browse files
committed
feat(CC-batch-4): moved directory, updated for review
1 parent 72bd8f5 commit 9e4b7e6

28 files changed

Lines changed: 266 additions & 408 deletions
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { DataList } from '@patternfly/react-core';
2+
import figma from '@figma/code-connect';
3+
4+
/**
5+
* PatternFly DataList component integration for Figma Code Connect
6+
*/
7+
8+
figma.connect(
9+
DataList,
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=6649-80542&m=dev',
11+
{
12+
props: {
13+
// enum
14+
isCompact: figma.enum('Size', { Compact: true }),
15+
isExpanded: figma.boolean('Expandable'),
16+
17+
children: figma.children('*')
18+
},
19+
example: (props) => <DataList isExpanded={props.isExpanded} isCompact={props.isCompact}>{props.children}</DataList>
20+
}
21+
);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import figma from '@figma/code-connect';
2+
import { DataListItem } from '@patternfly/react-core';
3+
4+
/**
5+
* PatternFly DataListItem component integration for Figma Code Connect
6+
*/
7+
8+
figma.connect(
9+
DataListItem,
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=6649-69488&m=dev',
11+
{
12+
props: {
13+
// boolean
14+
showLeftControls: figma.boolean('Show Left controls'),
15+
showRightActions: figma.boolean('Show right actions'),
16+
isSelected: figma.boolean('Selected'),
17+
isExpanded: figma.boolean('Expanded'),
18+
19+
// enum
20+
isCompact: figma.enum('Size', { Compact: true }),
21+
22+
children: figma.children('*')
23+
},
24+
example: (props) => (
25+
<DataListItem selected={props.isSelected} isExpanded={props.isExpanded} isCompact={props.isCompact}>
26+
{props.children}
27+
</DataListItem>
28+
)
29+
}
30+
);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { DescriptionList } from '@patternfly/react-core';
2+
import figma from '@figma/code-connect';
3+
4+
/**
5+
* PatternFly DescriptionList component integration for Figma Code Connect
6+
*/
7+
8+
figma.connect(
9+
DescriptionList,
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1121-3946&m=dev',
11+
{
12+
props: {
13+
// enum
14+
isCompact: figma.enum('Spacing', { Compact: true }),
15+
isFluid: figma.enum('Orientation', { 'Horizontal - Fluid': true }),
16+
isHorizontal: figma.enum('Orientation', {
17+
'Horizontal - Fixed': true,
18+
'Horizontal - Fluid': true
19+
}),
20+
21+
children: figma.children('*')
22+
},
23+
example: (props) => (
24+
<DescriptionList isFluid={props.isFluid} isCompact={props.isCompact} isHorizontal={props.isHorizontal}>
25+
{props.children}
26+
</DescriptionList>
27+
)
28+
}
29+
);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import figma from '@figma/code-connect';
2+
import { DescriptionListGroup, DescriptionListDescription } from '@patternfly/react-core';
3+
4+
figma.connect(
5+
DescriptionListGroup,
6+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1121-3571&m=dev',
7+
{
8+
props: {
9+
// string
10+
content: figma.string('✏️ Content'),
11+
12+
// enum
13+
type: figma.enum('Type', {
14+
Vertical: 'vertical',
15+
'Horizontal fluid': 'horizontal-fluid',
16+
'Horizontal fixed': 'horizontal-fixed'
17+
}),
18+
19+
// instance
20+
swapLabel: figma.instance('Swap label'),
21+
22+
children: figma.children('*')
23+
},
24+
25+
example: (props) => (
26+
<DescriptionListGroup>
27+
{props.children}
28+
<DescriptionListDescription>{props.content}</DescriptionListDescription>
29+
</DescriptionListGroup>
30+
)
31+
}
32+
);

packages/react-core/codeConnect/components/DescriptionList/TermLabel.figma.tsx renamed to packages/code-connect/components/DescriptionList/TermLabel.figma.tsx

File renamed without changes.

packages/react-core/codeConnect/components/Divider/Divider.figma.tsx renamed to packages/code-connect/components/Divider/Divider.figma.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ figma.connect(
1010
* TODO: This is a good example of how properties in Figma and props in React would benefit from naming consistency
1111
* React is looking for orientation, figma is defining orientation as 'Direction'
1212
*/
13-
orientation: figma.enum('Direction', {
14-
Vertical: { default: 'vertical' }
13+
isHorizontal: figma.enum('Direction', {
14+
Horizontal: { default: 'horizontal' }
1515
}),
1616
/**
1717
* TODO: Figma allows optional insets, but default to insetMd
1818
*/
1919
inset: figma.boolean('With insets', {
20-
true: { default: 'insetMd' },
21-
false: undefined
20+
true: { default: 'insetMd' }
2221
})
2322
},
24-
example: (props) => <Divider orientation={props.orientation} inset={props.inset} />
23+
example: (props) => <Divider orientation={props.isHorizontal} inset={props.inset} />
2524
}
2625
);

packages/react-core/codeConnect/components/Drawer/Drawer.figma.tsx renamed to packages/code-connect/components/Drawer/Drawer.figma.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,28 @@ import { Drawer } from '@patternfly/react-core';
55
* PatternFly Drawer component integration for Figma Code Connect
66
*/
77

8+
const main = {
9+
title: 'teste'
10+
};
11+
812
figma.connect(
913
Drawer,
1014
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=8034-7676&t=IzSunfrnw18ti37Y-11',
1115
{
1216
props: {
1317
// boolean
1418
isExpanded: figma.boolean('Show Footer actions'),
15-
isInline: figma.boolean('Has tabs'),
19+
isInline: figma.enum('Type', { Inline: true }),
1620
isResizable: figma.boolean('Is resizable'),
1721
isStatic: figma.boolean('Has action icon'),
1822

1923
// enum
20-
position: figma.enum('Position', {
21-
'Right - In Main Content Area': 'end',
22-
'Left - Full Page': 'start',
23-
'Bottom - Full page': 'bottom',
24-
'Right - Full page': 'end',
25-
'Bottom - In Main Content Area': 'bottom',
26-
'Left - In Main Content Area': 'start'
27-
}),
24+
isLeft: figma.enum('Position', { Left: 'start' }),
2825

2926
children: figma.children('*')
3027
},
3128
example: (props) => (
32-
<Drawer
33-
isExpanded={props.isExpanded}
34-
isInline={props.isInline}
35-
isStatic={props.isStatic}
36-
position={props.position}
37-
>
29+
<Drawer isExpanded={props.isExpanded} isInline={props.isInline} isStatic={props.isStatic} position={props.isLeft}>
3830
{props.children}
3931
</Drawer>
4032
)

packages/react-core/codeConnect/components/Drawer/DrawerContent.figma.tsx renamed to packages/code-connect/components/Drawer/DrawerContent.figma.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import figma from '@figma/code-connect';
22
import { DrawerContent } from '@patternfly/react-core';
33

44
/**
5-
* PatternFly DrawerContent component integration for Figma Code Connect
5+
* PatternFly DrawerTabs component integration for Figma Code Connect
66
*/
77

88
figma.connect(
99
DrawerContent,
1010
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=35627-47890&m=dev',
1111
{
12-
props: { children: figma.children('*') },
12+
props: {
13+
children: figma.children('*')
14+
},
1315
example: (props) => <DrawerContent>{props.children}</DrawerContent>
1416
}
1517
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import figma from '@figma/code-connect';
2+
import { DrawerContent } from '@patternfly/react-core';
3+
4+
/**
5+
* PatternFly DrawerMain component integration for Figma Code Connect
6+
*/
7+
8+
figma.connect(
9+
DrawerContent,
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=35586-211216&m=dev',
11+
{
12+
props: {
13+
children: figma.children('*')
14+
},
15+
example: (props) => <DrawerContent>{props.children}</DrawerContent>
16+
}
17+
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import figma from '@figma/code-connect';
2+
import { DualListSelectorPane } from '@patternfly/react-core';
3+
4+
/**
5+
* PatternFly DualListSelectorHeader component integration for Figma Code Connect
6+
*/
7+
8+
figma.connect(
9+
DualListSelectorPane,
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=21279-116172&m=dev',
11+
{
12+
props: {
13+
// string
14+
headerText: figma.string('Header text'),
15+
itemInformation: figma.string('Item information'),
16+
17+
children: figma.children('*')
18+
},
19+
example: (props) => <DualListSelectorPane title={props.headerText}>{props.children}</DualListSelectorPane>
20+
}
21+
);

0 commit comments

Comments
 (0)