Skip to content

Commit dcef261

Browse files
committed
feat(CC-batch-2): updated directory location
1 parent e247d1d commit dcef261

12 files changed

Lines changed: 147 additions & 91 deletions

packages/code-connect/components/Alert/InlineAlert.figma.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
import figma from '@figma/code-connect';
22
import { Alert } from '@patternfly/react-core';
33

4-
// Documentation for Alert can be found at https://www.patternfly.org/components/alert
4+
/**
5+
* PatternFly Alert component integration for Figma Code Connect
6+
*/
57

68
figma.connect(
79
Alert,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2698',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2698&m=dev',
911
{
1012
props: {
11-
// string
12-
description: figma.string('✏️ Title'),
13-
title: figma.string('✏️ Title'),
14-
15-
// boolean
13+
// booleans
14+
description: figma.boolean('Description', {
15+
true: figma.string('✏️ Description'),
16+
false: undefined
17+
}),
18+
hasActions: figma.boolean('Actions'),
19+
isDismissable: figma.boolean('Dismissable'),
1620
isExpandable: figma.boolean('Expandable'),
1721

18-
// enum
22+
// strings
23+
title: figma.string('✏️ Title'),
24+
25+
// enums
1926
variant: figma.enum('Type', {
2027
Info: 'info',
2128
Success: 'success',
@@ -25,7 +32,14 @@ figma.connect(
2532
})
2633
},
2734
example: (props) => (
28-
<Alert isExpandable={props.isExpandable} isInline title={props.title} variant={props.variant}>
35+
<Alert
36+
actionClose={props.isDismissable}
37+
actionLinks={props.hasActions}
38+
isExpandable={props.isExpandable}
39+
isInline
40+
title={props.title}
41+
variant={props.variant}
42+
>
2943
{props.description}
3044
</Alert>
3145
)
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import figma from '@figma/code-connect';
22
import { AlertGroup } from '@patternfly/react-core';
33

4-
// Documentation for Alert can be found at https://www.patternfly.org/components/alert
4+
/**
5+
* PatternFly Alert component integration for Figma Code Connect
6+
*/
57

68
figma.connect(
79
AlertGroup,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2780',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2780&m=dev',
911
{
1012
props: {
13+
// children
1114
children: figma.children('*')
1215
},
13-
example: (props) => (
14-
<AlertGroup isLiveRegion hasAnimations>
15-
{props.children}
16-
</AlertGroup>
17-
)
16+
example: (props) => <AlertGroup>{props.children}</AlertGroup>
1817
}
1918
);
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import figma from '@figma/code-connect';
22
import { Alert } from '@patternfly/react-core';
33

4-
// Documentation for Alert can be found at https://www.patternfly.org/components/alert
4+
/**
5+
* PatternFly Alert component integration for Figma Code Connect
6+
*/
57

68
figma.connect(
79
Alert,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2754',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2754&m=dev',
911
{
1012
props: {
11-
// string
12-
description: figma.string('✏️ Title'),
13+
// strings
1314
title: figma.string('✏️ Title'),
1415

15-
// enum
16+
// variants
1617
variant: figma.enum('Type', {
1718
Info: 'info',
1819
Success: 'success',
@@ -21,12 +22,11 @@ figma.connect(
2122
Custom: 'custom'
2223
}),
2324

25+
// children
2426
children: figma.children('*')
2527
},
2628
example: (props) => (
27-
<Alert isInline isPlain title={props.title} variant={props.variant} variantLabel={props.variant}>
28-
{props.description}
29-
</Alert>
29+
<Alert variant={props.variant} title={props.title} variantLabel={props.variant} isInline isPlain />
3030
)
3131
}
3232
);
Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,20 @@
11
import figma from '@figma/code-connect';
2-
import { Alert, AlertActionCloseButton, AlertGroup } from '@patternfly/react-core';
2+
import { AlertGroup } from '@patternfly/react-core';
33

4-
// Documentation for Alert can be found at https://www.patternfly.org/components/alert
4+
/**
5+
* PatternFly Alert component integration for Figma Code Connect
6+
*/
57

68
figma.connect(
79
AlertGroup,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2784',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2784&m=dev',
911
{
1012
props: {
11-
overflowMessage: figma.string('✏️ Title')
13+
// strings
14+
overflowMessage: figma.string('✏️ Title'),
15+
16+
children: figma.children('*')
1217
},
13-
example: (props) => (
14-
<AlertGroup isLiveRegion hasAnimations onOverflowClick={() => {}} overflowMessage={props.overflowMessage}>
15-
<Alert
16-
variant="info"
17-
title="Alert one"
18-
actionClose={<AlertActionCloseButton title="Close alert" variantLabel="Alert one" onClose={() => {}} />}
19-
key={1}
20-
/>
21-
<Alert
22-
variant="success"
23-
title="Alert two"
24-
actionClose={<AlertActionCloseButton title="Close alert" variantLabel="Alert two" onClose={() => {}} />}
25-
key={2}
26-
/>
27-
<Alert
28-
variant="warning"
29-
title="Alert three"
30-
actionClose={<AlertActionCloseButton title="Close alert" variantLabel="Alert three" onClose={() => {}} />}
31-
key={3}
32-
/>
33-
<Alert
34-
variant="danger"
35-
title="Alert four"
36-
actionClose={<AlertActionCloseButton title="Close alert" variantLabel="Alert four" onClose={() => {}} />}
37-
key={4}
38-
/>
39-
</AlertGroup>
40-
)
18+
example: (props) => <AlertGroup overflowMessage={props.overflowMessage}>{props.children}</AlertGroup>
4119
}
4220
);

packages/code-connect/components/Alert/ToastAlert.figma.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
import figma from '@figma/code-connect';
22
import { Alert } from '@patternfly/react-core';
33

4-
// Documentation for Alert can be found at https://www.patternfly.org/components/alert
4+
/**
5+
* PatternFly Alert component integration for Figma Code Connect
6+
*/
57

68
figma.connect(
79
Alert,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2587',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2587&m=dev',
911
{
1012
props: {
11-
// string
12-
description: figma.string('✏️ Title'),
13-
title: figma.string('✏️ Title'),
14-
15-
// boolean
13+
// booleans
14+
actionLinks: figma.boolean('Actions'),
15+
alertDescription: figma.boolean('Description', {
16+
true: figma.string('✏️ Description'),
17+
false: undefined
18+
}),
1619
isExpandable: figma.boolean('Expandable'),
1720

18-
// enum
21+
// strings
22+
title: figma.string('✏️ Title'),
23+
24+
// variants
1925
variant: figma.enum('Type', {
2026
Custom: 'custom',
2127
Danger: 'danger',
@@ -26,14 +32,12 @@ figma.connect(
2632
},
2733
example: (props) => (
2834
<Alert
29-
isExpandable={props.isExpandable}
3035
title={props.title}
3136
variant={props.variant}
32-
hasAnimations
33-
isToast
34-
isLiveRegion
37+
actionLinks={props.actionLinks}
38+
isExpandable={props.isExpandable}
3539
>
36-
{props.description}
40+
{props.alertDescription}
3741
</Alert>
3842
)
3943
}

packages/code-connect/components/Alert/ToastAlertGroup.figma.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import figma from '@figma/code-connect';
22
import { AlertGroup } from '@patternfly/react-core';
33

4-
// Documentation for AlertGroup can be found at https://www.patternfly.org/components/alert
4+
// Documentation for Alert can be found at https://www.patternfly.org/components/alert
55

66
figma.connect(
77
AlertGroup,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2821',
8+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1110-2780',
99
{
1010
props: {
1111
children: figma.children('*')
1212
},
1313
example: (props) => (
14-
<AlertGroup hasAnimations isToast isLiveRegion>
14+
<AlertGroup isLiveRegion hasAnimations>
1515
{props.children}
1616
</AlertGroup>
1717
)

packages/code-connect/components/Avatar/Avatar.figma.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ figma.connect(
88
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6%3A-Components-Test?node-id=1561-4342',
99
{
1010
props: {
11-
// boolean
11+
// booleans
1212
isBordered: figma.boolean('Bordered'),
1313

14-
// enum
14+
// enums
1515
size: figma.enum('Size', {
1616
small: 'sm',
1717
med: 'md',
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
import figma from '@figma/code-connect';
22
import { Badge } from '@patternfly/react-core';
33

4-
// Documentation for Badge can be found at https://www.patternfly.org/components/badge
4+
/**
5+
* PatternFly Badge component integration for Figma Code Connect
6+
*/
57

68
figma.connect(
79
Badge,
8-
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1259-1132',
10+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1259-1132&m=dev',
911
{
1012
props: {
11-
// string
12-
text: figma.string('Text'),
13+
// strings
14+
title: figma.string('Text'),
1315

14-
// enum
15-
isDisabled: figma.enum('Type', { disabled: true }),
16-
isRead: figma.enum('Type', { Read: true })
16+
// enums
17+
isRead: figma.enum('Type', {
18+
Read: true
19+
}),
20+
isDisabled: figma.enum('Type', {
21+
disabled: true
22+
})
1723
},
18-
example: (props) => (
19-
<Badge isRead={props.isRead} isDisabled={props.isDisabled} screenReaderText="Badge example">
20-
{props.text}
21-
</Badge>
22-
)
24+
example: (props) => <Badge title={props.title} isRead={props.isRead} isDisabled={props.isDisabled} />
2325
}
2426
);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { useState, Dispatch, SetStateAction } from 'react';
2+
3+
/**
4+
* Reusable hook for managing expandable state.
5+
* @param initialExpanded - Initial expanded state (default: false)
6+
*/
7+
export function useExpandable(initialExpanded: boolean = false): [boolean, Dispatch<SetStateAction<boolean>>] {
8+
const [isExpanded, setIsExpanded] = useState(initialExpanded);
9+
return [isExpanded, setIsExpanded];
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import figma from '@figma/code-connect';
2+
import { Icon } from '@patternfly/react-core';
3+
4+
// Documentation for Icon can be found at https://www.patternfly.org/components/icon
5+
6+
figma.connect(
7+
Icon,
8+
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=35205-247',
9+
{
10+
props: {
11+
// instance: figma.children('Icon'),
12+
children: figma.children('*')
13+
},
14+
example: (props) => <>{props.children}</>
15+
}
16+
);

0 commit comments

Comments
 (0)