Skip to content

Commit c4b7e8f

Browse files
committed
feat(guidebanner): code connect
1 parent f76bd54 commit c4b7e8f

File tree

3 files changed

+83
-6
lines changed

3 files changed

+83
-6
lines changed

packages/ibm-products/src/components/Guidebanner/Guidebanner.figma.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ figma.connect(
2626
Collapsable: true,
2727
}),
2828
title: figma.string('Header text'),
29-
children: figma.enum('Type', {
30-
Static: undefined,
31-
Expandable: figma.instance('Swap slot'),
32-
}),
29+
// children: figma.enum('Type', {
30+
// "Not collapsible": undefined,
31+
// Collapsible: figma.children('_Insight'),
32+
// }),
33+
children: figma.children('_Insight'),
3334
open: figma.boolean('Expanded'),
34-
expandButtonLabel: figma.textContent('Read more'),
3535
// No matching props could be found for these Figma properties:
3636
// "headerText": figma.string('Header text'),
3737
// "expanded": figma.boolean('Expanded'),
@@ -42,7 +42,6 @@ figma.connect(
4242
collapsible={props.collapsible}
4343
title={props.title}
4444
open={props.open}
45-
expandButtonLabel={props.expandButtonLabel}
4645
>
4746
{props.children}
4847
</Guidebanner>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Copyright IBM Corp. 2025
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+
import React from 'react';
9+
import { GuidebannerElement } from './GuidebannerElement';
10+
import figma from '@figma/code-connect';
11+
12+
/**
13+
* -- This file was auto-generated by Code Connect --
14+
* None of your props could be automatically mapped to Figma properties.
15+
* You should update the `props` object to include a mapping from your
16+
* code props to Figma properties, and update the `example` function to
17+
* return the code example you'd like to see in Figma
18+
*/
19+
20+
figma.connect(
21+
GuidebannerElement,
22+
'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=16728%3A642201',
23+
{
24+
props: {
25+
description: figma.enum('Content', {
26+
'Plain text': 'plain-text',
27+
'Non linear': 'non-linear',
28+
}),
29+
// button: figma.enum('CTA', {
30+
// "Tertiary button": "tertiary-button",
31+
// "Ghost button": "ghost-button",
32+
// "Link": "link",
33+
// "No CTA": "no-cta"
34+
// })
35+
button: figma.children('_Guide banner button'),
36+
},
37+
example: (props) => (
38+
<GuidebannerElement
39+
description={props.description}
40+
button={props.button}
41+
/>
42+
),
43+
}
44+
);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Copyright IBM Corp. 2025
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+
import React from 'react';
9+
import { GuidebannerElementButton } from './GuidebannerElementButton';
10+
import figma from '@figma/code-connect';
11+
12+
/**
13+
* -- This file was auto-generated by Code Connect --
14+
* None of your props could be automatically mapped to Figma properties.
15+
* You should update the `props` object to include a mapping from your
16+
* code props to Figma properties, and update the `example` function to
17+
* return the code example you'd like to see in Figma
18+
*/
19+
20+
figma.connect(
21+
GuidebannerElementButton,
22+
'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=17606%3A27272',
23+
{
24+
props: {
25+
children: figma.enum('State', {
26+
Enabled: figma.string('Text'),
27+
Hover: figma.string('Text'),
28+
}),
29+
},
30+
example: (props) => (
31+
<GuidebannerElementButton>{props.children}</GuidebannerElementButton>
32+
),
33+
}
34+
);

0 commit comments

Comments
 (0)