Skip to content

Commit 5e16052

Browse files
committed
feat(code-connect): ailabel and ailabelcontent
1 parent d82c544 commit 5e16052

File tree

4 files changed

+141
-1
lines changed

4 files changed

+141
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2024
3+
*
4+
* This source code is licensed under the Apache-2.0 license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// @ts-nocheck
9+
import React from 'react';
10+
import { AILabel } from '@carbon/react';
11+
import figma from '@figma/code-connect';
12+
13+
figma.connect(
14+
AILabel,
15+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=51447-1916&t=9XaizJDx8eI6KgQz-4',
16+
{
17+
props: {
18+
aiText: figma.string('Text translation'),
19+
size: figma.enum('Size', {
20+
'16px': 'mini',
21+
'20px': '2xs',
22+
'24px': 'xs',
23+
'32px': 'sm',
24+
'40px': 'md',
25+
'48px': 'lg',
26+
'64px': 'xl',
27+
}),
28+
},
29+
example: ({ ...props }) => <AILabel autoAlign {...props} />,
30+
}
31+
);
32+
33+
// inline
34+
figma.connect(
35+
AILabel,
36+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=51447-2035&t=9XaizJDx8eI6KgQz-4',
37+
{
38+
props: {
39+
aiText: figma.string('Text translation'),
40+
textLabel: figma.enum('Type', {
41+
'Text + Icon': figma.string('Slug text'),
42+
}),
43+
size: figma.enum('Size', {
44+
'12px': 'sm',
45+
'14px': 'md',
46+
'16px': 'lg',
47+
}),
48+
},
49+
example: ({ ...props }) => <AILabel autoAlign kind="inline" {...props} />,
50+
}
51+
);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2024
3+
*
4+
* This source code is licensed under the Apache-2.0 license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// @ts-nocheck
9+
import React from 'react';
10+
import { AILabelActions } from '@carbon/react';
11+
import figma from '@figma/code-connect';
12+
13+
figma.connect(
14+
AILabelActions,
15+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=57561-3559&t=SB9qULZbn3FRopvU-4',
16+
{
17+
props: {
18+
detailsbutton59717: figma.boolean('Details button'),
19+
action359716: figma.boolean('Action 3'),
20+
action259715: figma.boolean('Action 2'),
21+
action159714: figma.boolean('Action 1'),
22+
children: figma.children('*'),
23+
},
24+
example: ({ children }) => <AILabelActions>{children}</AILabelActions>,
25+
}
26+
);
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/**
2+
* Copyright IBM Corp. 2016, 2024
3+
*
4+
* This source code is licensed under the Apache-2.0 license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// @ts-nocheck
9+
import React from 'react';
10+
import { AILabelContent } from '@carbon/react';
11+
import figma from '@figma/code-connect';
12+
13+
figma.connect(
14+
AILabelContent,
15+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=57561-3508&t=SB9qULZbn3FRopvU-4',
16+
{
17+
props: {
18+
title: figma.string('AI title'),
19+
description: figma.string('AI description'),
20+
slotOne: figma.boolean('Slot 1', {
21+
true: figma.instance('Swap slot 1'),
22+
false: '',
23+
}),
24+
slotTwo: figma.boolean('Slot 2', {
25+
true: figma.instance('Swap slot 2'),
26+
}),
27+
slotThree: figma.boolean('Slot 3', {
28+
true: figma.instance('Swap slot 3'),
29+
}),
30+
slotFour: figma.boolean('Slot 4', {
31+
true: figma.instance('Swap slot 4'),
32+
}),
33+
actions: figma.children(['Actions footer']),
34+
},
35+
example: ({
36+
title,
37+
description,
38+
slotOne,
39+
slotTwo,
40+
slotThree,
41+
slotFour,
42+
actions,
43+
}) => (
44+
<AILabelContent>
45+
{slotOne}
46+
<div>
47+
<p>AI Explained</p>
48+
<h1>{title}</h1>
49+
<p>{description}</p>
50+
{slotOne}
51+
<hr />
52+
{slotTwo}
53+
<p>
54+
This is sample placeholder content, replace with your own content
55+
and custom styles.
56+
</p>
57+
{slotThree}
58+
{slotFour}
59+
</div>
60+
{actions}
61+
</AILabelContent>
62+
),
63+
}
64+
);

packages/react/code-connect/Tabs/Tabs.figma.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
/* eslint-disable react/jsx-no-duplicate-props */
98
// @ts-nocheck
109
import React from 'react';
1110
import {

0 commit comments

Comments
 (0)