Skip to content

Commit 02b5595

Browse files
authored
feat(link): add web components Link mapping and align Link type variants (#22253)
1 parent ebc609c commit 02b5595

2 files changed

Lines changed: 42 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2024
2+
* Copyright IBM Corp. 2016, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
66
*/
77

88
import React from 'react';
99
import { Link } from '@carbon/react';
10+
import type { ComponentType } from 'react';
1011
import figma from '@figma/code-connect';
1112

1213
figma.connect(
@@ -16,9 +17,10 @@ figma.connect(
1617
props: {
1718
inline: figma.enum('Type', {
1819
Inline: true,
20+
Standalone: false,
1921
}),
2022
linkText: figma.string('Link text'),
21-
renderIcon: figma.instance('Swap icon'),
23+
renderIcon: figma.instance<ComponentType>('Swap icon'),
2224
size: figma.enum('Size', {
2325
Large: 'lg',
2426
Medium: 'md',
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright IBM Corp. 2026
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 figma, { html } from '@figma/code-connect/html';
9+
10+
figma.connect(
11+
'https://www.figma.com/file/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?type=design&node-id=50111-991&mode=design&t=kyFCPK0tCeufcNP2-4',
12+
{
13+
props: {
14+
inline: figma.enum('Type', {
15+
Inline: true,
16+
Standalone: false,
17+
}),
18+
linkText: figma.string('Link text'),
19+
renderIcon: figma.instance('Swap icon'),
20+
size: figma.enum('Size', {
21+
Large: 'lg',
22+
Medium: 'md',
23+
Small: 'sm',
24+
}),
25+
disabled: figma.enum('State', {
26+
Disabled: true,
27+
}),
28+
},
29+
example: (props) =>
30+
html` <cds-link
31+
inline=${props.inline}
32+
size=${props.size}
33+
disabled=${props.disabled}>
34+
${props.linkText} ${props.renderIcon}
35+
</cds-link>`,
36+
imports: ["import '@carbon/web-components/es/components/link/link.js'"],
37+
}
38+
);

0 commit comments

Comments
 (0)