Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ lerna-debug.log
# For vim
*.swp
.yarn
.env
100 changes: 100 additions & 0 deletions packages/code-connect/components/ProgressBar/ProgressBar.figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import figma from '@figma/code-connect';
import { ProgressBar, ProgressMeasureLocation } from '@patternfly/react-core';

// Documentation for ProgressBar can be found at https://www.patternfly.org/components/progress-bar
const sharedProps = {
helperText: figma.boolean('Show helper text', {
true: 'This is a helper text',
false: undefined
}),
size: figma.enum('Size', {
Default: 'md',
Small: 'sm',
Large: 'lg'
}),
title: figma.string('Title'),
measureLocation: {
outside: figma.boolean('Show outside percentage', {
true: 'outside',
false: undefined
}),
inside: figma.boolean('Show main percentage', {
true: 'inside',
false: undefined
})
},
variant: figma.enum('State', {
Success: 'success',
Warning: 'warning',
Danger: 'danger'
})
};

figma.connect(
ProgressBar,
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=7644-38395',
{
variant: { 'Show outside percentage': true },
props: {
...sharedProps
},
example: (props) => (
<ProgressBar
aria-describedby="progress-bar-example-helper-text"
helperText={props.helperText}
id="progress-bar-example"
measureLocation={ProgressMeasureLocation.outside}
size={props.size}
title={props.title}
value={50}
variant={props.variant}
/>
)
}
);

figma.connect(
ProgressBar,
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=7644-38395',
{
variant: { 'Show main percentage': true },
props: {
...sharedProps
},
example: (props) => (
<ProgressBar
aria-describedby="progress-bar-example-helper-text"
helperText={props.helperText}
id="progress-bar-example"
measureLocation={ProgressMeasureLocation.inside}
size={props.size}
title={props.title}
value={50}
variant={props.variant}
/>
)
}
);

// Base ProgressBar
figma.connect(
ProgressBar,
'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=7644-38395',
{
props: {
...sharedProps
},
example: (props) => (
<ProgressBar
aria-describedby="progress-bar-example-helper-text"
helperText={props.helperText}
id="progress-bar-example"
measureLocation={ProgressMeasureLocation.none}
size={props.size}
title={props.title}
value={50}
variant={props.variant}
/>
)
}
);
13 changes: 5 additions & 8 deletions packages/code-connect/figma.config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"codeConnect": {
"parser": "react",
"include": [
"components/DatePicker/*.tsx",
"components/EmptyState/*.tsx",
"components/FileUpload/*.tsx",
"components/Hint/*.tsx",
"components/InlineEdit/*.tsx"
],
"include": ["components/ProgressBar/*.figma.tsx"],
"documentUrlSubstitutions": {
"https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components": "https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/branch/e1OeQDrgPKW13FswRqSP3I/PatternFly-6--Components"
},
"paths": {
"src/components": "src/components"
},
Expand All @@ -30,4 +27,4 @@
}
}
}
}
}
Loading