Skip to content

Commit 2637d10

Browse files
heloiseluitay1orjonesadamalston
authored
fix(code-connect): update ProgressBar mappings (#22105)
* fix(code-connect): update ProgressBar mappings and type prop error * Apply suggestion from @adamalston Co-authored-by: Adam Alston <aalston9@gmail.com> --------- Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com> Co-authored-by: Adam Alston <aalston9@gmail.com>
1 parent 51624f6 commit 2637d10

1 file changed

Lines changed: 83 additions & 86 deletions

File tree

Lines changed: 83 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,93 @@
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

8-
// import React from 'react';
9-
// import { ProgressBar } from '@carbon/react';
10-
// import figma from '@figma/code-connect';
8+
import React from 'react';
9+
import { ProgressBar } from '@carbon/react';
10+
import figma from '@figma/code-connect';
1111

12-
// TODO: Re-enable these components when Code Connect validation bug is fixed
13-
// Properties exist in Figma but fail validation despite correct names:
14-
// https://github.com/carbon-design-system/carbon/issues/20089
12+
const sharedProgressBarProps = {
13+
label: figma.string('Label text'),
14+
value: figma.enum('Progress', {
15+
'0%': 0,
16+
'25%': 25,
17+
'50%': 50,
18+
'75%': 75,
19+
}),
20+
type: figma.enum('Alignment', {
21+
Inline: 'inline',
22+
Indent: 'indented',
23+
}),
24+
status: figma.enum('Status', {
25+
Active: 'active',
26+
Success: 'finished',
27+
Error: 'error',
28+
}),
29+
size: figma.enum('Size', {
30+
Big: 'big',
31+
Small: 'small',
32+
}),
33+
helperText: figma.string('Helper text'),
34+
helperTextError: figma.string('Error text'),
35+
helperTextSuccess: figma.string('Success text'),
36+
};
1537

16-
// const sharedProgressBarProps = {
17-
// label: figma.string('Label text'),
18-
// value: figma.enum('Progress', {
19-
// '0%': 0,
20-
// '25%': 25,
21-
// '50%': 50,
22-
// '75%': 75,
23-
// }),
24-
// type: figma.enum('Alignment', {
25-
// Inline: 'inline',
26-
// Indent: 'indent',
27-
// }),
28-
// status: figma.enum('State', {
29-
// Active: 'active',
30-
// Success: 'finished',
31-
// Error: 'error',
32-
// }),
33-
// size: figma.enum('Size', {
34-
// Big: 'big',
35-
// Small: 'small',
36-
// }),
37-
// helperText: figma.string('Helper text'),
38-
// helperTextError: figma.string('Error text'),
39-
// helperTextSuccess: figma.string('Success text'),
40-
// };
38+
figma.connect(
39+
ProgressBar,
40+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=9506-402924&t=j280IIQF1o3iLkV2-4',
41+
{
42+
variant: { Status: 'Active' },
43+
props: sharedProgressBarProps,
44+
example: ({ label, value, helperText, status, type, size }) => (
45+
<ProgressBar
46+
label={label}
47+
value={value}
48+
helperText={helperText}
49+
status={status}
50+
type={type}
51+
size={size}
52+
/>
53+
),
54+
}
55+
);
4156

42-
// figma.connect(
43-
// ProgressBar,
44-
// 'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=9506-402924&t=j280IIQF1o3iLkV2-4',
45-
// {
46-
// props: sharedProgressBarProps,
47-
// example: ({ label, value, helperText, status, type, size }) => (
48-
// <ProgressBar
49-
// label={label}
50-
// value={value}
51-
// helperText={helperText}
52-
// status={status}
53-
// type={type}
54-
// size={size}
55-
// />
56-
// ),
57-
// }
58-
// );
57+
figma.connect(
58+
ProgressBar,
59+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=9506-402924&t=j280IIQF1o3iLkV2-4',
60+
{
61+
variant: { Status: 'Error' },
62+
props: sharedProgressBarProps,
63+
example: ({ label, value, status, type, size, helperTextError }) => (
64+
<ProgressBar
65+
label={label}
66+
value={value}
67+
helperText={helperTextError}
68+
status={status}
69+
type={type}
70+
size={size}
71+
/>
72+
),
73+
}
74+
);
5975

60-
// figma.connect(
61-
// ProgressBar,
62-
// 'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=9506-402924&t=j280IIQF1o3iLkV2-4',
63-
// {
64-
// variant: { State: 'Error' },
65-
// props: sharedProgressBarProps,
66-
// example: ({ label, value, status, type, size, helperTextError }) => (
67-
// <ProgressBar
68-
// label={label}
69-
// value={value}
70-
// helperText={helperTextError}
71-
// status={status}
72-
// type={type}
73-
// size={size}
74-
// />
75-
// ),
76-
// }
77-
// );
78-
79-
// figma.connect(
80-
// ProgressBar,
81-
// 'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=9506-402924&t=j280IIQF1o3iLkV2-4',
82-
// {
83-
// variant: { State: 'Success' },
84-
// props: sharedProgressBarProps,
85-
// example: ({ label, value, status, type, size, helperTextSuccess }) => (
86-
// <ProgressBar
87-
// label={label}
88-
// value={value}
89-
// helperText={helperTextSuccess}
90-
// status={status}
91-
// type={type}
92-
// size={size}
93-
// />
94-
// ),
95-
// }
96-
// );
76+
figma.connect(
77+
ProgressBar,
78+
'https://www.figma.com/design/YAnB1jKx0yCUL29j6uSLpg/(v11)-All-themes---Carbon-Design-System?node-id=9506-402924&t=j280IIQF1o3iLkV2-4',
79+
{
80+
variant: { Status: 'Success' },
81+
props: sharedProgressBarProps,
82+
example: ({ label, value, status, type, size, helperTextSuccess }) => (
83+
<ProgressBar
84+
label={label}
85+
value={value}
86+
helperText={helperTextSuccess}
87+
status={status}
88+
type={type}
89+
size={size}
90+
/>
91+
),
92+
}
93+
);

0 commit comments

Comments
 (0)