Skip to content

Commit e57eb80

Browse files
chore: add options-tile wc code connect (#8433)
* chore: add options-tile wc code connect * fix: remove figma files from ts check in wc package * fix: review changes --------- Co-authored-by: Jeff Longshore <[email protected]>
1 parent 6ff6d26 commit e57eb80

File tree

3 files changed

+93
-1
lines changed

3 files changed

+93
-1
lines changed

packages/ibm-products-web-components/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@carbon/ibm-products-styles": "^2.75.0",
6060
"@carbon/styles": "^1.93.1",
6161
"@carbon/web-components": "2.41.1",
62+
"@figma/code-connect": "^1.3.6",
6263
"@ibm/telemetry-js": "^1.10.2",
6364
"@lit-labs/signals": "^0.1.2",
6465
"@lit/context": "^1.1.5",
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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 './options-tile';
9+
import figma, { html } from '@figma/code-connect/html';
10+
11+
figma.connect(
12+
'https://www.figma.com/design/0F9dKH2abAd7gSfvnacfWf/-v11--IBM-Products-%E2%80%93-Carbon-Design-System?node-id=36228%3A14503',
13+
{
14+
props: {
15+
title: figma.string('Heading text'),
16+
open: figma.boolean('Expanded'),
17+
size: figma.enum('Size', {
18+
Large: 'lg',
19+
'Extra large': 'xl',
20+
}),
21+
toggle: figma.boolean('Toggle', {
22+
true: '<cds-toggle id="my-toggle" size="sm" hideLabel></cds-toggle>',
23+
false: undefined,
24+
}),
25+
children: figma.enum('Type', {
26+
Static: undefined,
27+
Expandable: figma.instance('Swap slot'),
28+
}),
29+
summaryProps: figma.boolean('Summary + Validation', {
30+
true: figma.nestedProps('Summary + Validation message', {
31+
locked: figma.enum('Type', {
32+
Summary: figma.boolean('Locked'),
33+
Warning: false,
34+
Error: false,
35+
}),
36+
summary: figma.enum('Type', {
37+
Summary: figma.string('Summary text'),
38+
Warning: undefined,
39+
Error: undefined,
40+
}),
41+
invalid: figma.enum('Type', {
42+
Summary: undefined,
43+
Warning: undefined,
44+
Error: true,
45+
}),
46+
invalidText: figma.enum('Type', {
47+
Summary: undefined,
48+
Warning: undefined,
49+
Error: figma.string('Error text'),
50+
}),
51+
warn: figma.enum('Type', {
52+
Summary: undefined,
53+
Warning: true,
54+
Error: undefined,
55+
}),
56+
warnText: figma.enum('Type', {
57+
Summary: undefined,
58+
Warning: figma.string('Warning text'),
59+
Error: undefined,
60+
}),
61+
}),
62+
false: {
63+
locked: undefined,
64+
summary: undefined,
65+
invalid: undefined,
66+
invalidText: undefined,
67+
warn: undefined,
68+
warnText: undefined,
69+
},
70+
}),
71+
},
72+
example: (props) => html`
73+
<c4p-options-tile
74+
?defaultOpen="${props.open}"
75+
size="${props.size}"
76+
titleText="${props.title}"
77+
>
78+
<div slot="summary">${props.summaryProps.summary}</div>
79+
<div slot="toggle">${props.toggle}</div>
80+
<div slot="body">${props.children}</div>
81+
</c4p-options-tile>
82+
`,
83+
imports: [
84+
"import '@carbon/ibm-products-web-components/es/components/options-tile/index';",
85+
],
86+
}
87+
);

packages/ibm-products-web-components/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@
3131
".storybook/**/*.ts",
3232
".storybook/**/*.tsx"
3333
],
34-
"exclude": ["src/**/*.stories.ts", "src/globals/internal/storybook-cdn.ts"]
34+
"exclude": [
35+
"src/**/*.stories.ts",
36+
"src/globals/internal/storybook-cdn.ts",
37+
"src/**/*.figma.ts"
38+
]
3539
}

0 commit comments

Comments
 (0)