-
Notifications
You must be signed in to change notification settings - Fork 368
feat(CC-batch-1): added batch 1 #11827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e49f563
9f6488f
8c034f0
79a0a79
eae1820
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import figma from '@figma/code-connect'; | ||
import { AboutModal } from '@patternfly/react-core'; | ||
|
||
figma.connect( | ||
AboutModal, | ||
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=2879-13973&t=15CEJpGgVui7qP5Q-11', | ||
{ | ||
props: { | ||
// string | ||
productName: figma.string('Product name'), | ||
|
||
trademark: 'Copyright © 2024', | ||
brandImageSrc: 'Brand Image Source', | ||
brandImageAlt: 'Brand Image Alt Text', | ||
backgroundImageSrc: '/assets/images/background.png', | ||
|
||
// children | ||
children: figma.children('*') | ||
}, | ||
example: (props) => ( | ||
// Documentation for AboutModal can be found at https://www.patternfly.org/components/about-modal | ||
<AboutModal | ||
productName={props.productName} | ||
trademark={props.trademark} | ||
brandImageSrc={props.brandImageSrc} | ||
brandImageAlt={props.brandImageAlt} | ||
backgroundImageSrc={props.backgroundImageSrc} | ||
> | ||
{props.children} | ||
</AboutModal> | ||
) | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import figma from '@figma/code-connect'; | ||
import { Accordion } from '@patternfly/react-core'; | ||
|
||
figma.connect( | ||
Accordion, | ||
'https://www.figma.com/file/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6%3A-Components-Test?node-id=2621-623', | ||
{ | ||
props: { | ||
// enum | ||
isBordered: figma.enum('Type', { | ||
Bordered: true, | ||
'Large Bordered': true | ||
}), | ||
displaySize: figma.enum('Type', { | ||
'Large Bordered': 'lg' | ||
}), | ||
togglePosition: figma.enum('Caret position', { | ||
Left: 'start' | ||
}), | ||
|
||
children: figma.children('*') | ||
}, | ||
example: (props) => ( | ||
// Documentation for Accordion can be found at https://www.patternfly.org/components/accordion | ||
<Accordion togglePosition={props.togglePosition} isBordered={props.isBordered} displaySize={props.displaySize}> | ||
{props.children} | ||
</Accordion> | ||
) | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import figma from '@figma/code-connect'; | ||
import { AccordionItem, AccordionToggle, AccordionContent } from '@patternfly/react-core'; | ||
|
||
figma.connect( | ||
AccordionToggle, | ||
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=1423-687', | ||
{ | ||
props: { | ||
// string | ||
expandText: figma.string('Expand Text'), | ||
|
||
// enum | ||
toggleTextExpanded: figma.enum('State', { | ||
Default: figma.string('Toggle Text'), | ||
Hover: figma.string('Toggle Text'), | ||
Expanded: figma.string('Toggle Text Expanded') | ||
}), | ||
isExpanded: figma.enum('State', { Expanded: true }), | ||
|
||
children: figma.children('*') | ||
}, | ||
example: (props) => ( | ||
// Documentation for Accordion can be found at https://www.patternfly.org/components/accordion | ||
<AccordionItem isExpanded={props.isExpanded}> | ||
<AccordionToggle onClick={() => {}} id="<your-id>"> | ||
{props.toggleTextExpanded} | ||
</AccordionToggle> | ||
<AccordionContent id="accordion-content-example"> | ||
<p>{props.expandText}</p> | ||
</AccordionContent> | ||
</AccordionItem> | ||
) | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import figma from '@figma/code-connect'; | ||
import { ActionList } from '@patternfly/react-core'; | ||
|
||
figma.connect( | ||
ActionList, | ||
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=6780-15839&m=dev', | ||
{ | ||
props: { | ||
isIconList: figma.enum('Type', { 'Action icons only': true }), | ||
children: figma.children('*') | ||
}, | ||
example: (props) => ( | ||
// Documentation for ActionList can be found at https://www.patternfly.org/components/action-list | ||
<ActionList isIconList={props.isIconList}>{props.children}</ActionList> | ||
) | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import figma from '@figma/code-connect'; | ||
import { BackgroundImage } from '@patternfly/react-core'; | ||
|
||
figma.connect( | ||
BackgroundImage, | ||
'https://www.figma.com/file/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6%3A-Components-Test?node-id=5047-695', | ||
{ | ||
props: { | ||
src: figma.string('Background Image Source') | ||
}, | ||
example: (props) => ( | ||
// Documentation for BackgroundImage can be found at https://www.patternfly.org/components/background-image | ||
<BackgroundImage src={props.src} /> | ||
) | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import figma from '@figma/code-connect'; | ||
import { ClipboardCopy } from '@patternfly/react-core'; | ||
|
||
figma.connect( | ||
ClipboardCopy, | ||
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=9914-75835&m=dev', | ||
{ | ||
props: { | ||
// enum | ||
isActive: figma.enum('State', { Active: true }), | ||
isReadOnly: figma.enum('State', { 'Read only': true }), | ||
isExpanded: figma.enum('State', { Expanded: true }), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a way in figma to make an expandable clipboardCopy variant? If so, then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can create an expansion var that references
|
||
expansion: figma.enum('State', { | ||
Expanded: 'expansion', | ||
false: undefined | ||
}), | ||
|
||
children: figma.children('*') | ||
}, | ||
example: (props) => ( | ||
// Documentation for ClipboardCopy can be found at https://www.patternfly.org/components/clipboard-copy | ||
<ClipboardCopy | ||
isReadOnly={props.isReadOnly} | ||
variant={props.expansion} | ||
isExpanded={props.isExpanded} | ||
isActive={props.isActive} | ||
> | ||
{props.children} | ||
</ClipboardCopy> | ||
) | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import figma from '@figma/code-connect'; | ||
import { ClipboardCopy } from '@patternfly/react-core'; | ||
|
||
/** | ||
* PatternFly AccordionToggle integration for Figma Code Connect | ||
* @patternfly https://www.patternfly.org/components/clipboard-copy | ||
*/ | ||
|
||
figma.connect( | ||
ClipboardCopy, | ||
'https://www.figma.com/design/aEBBvq0J3EPXxHvv6WgDx9/PatternFly-6--Components-Test?node-id=9914-75768&m=dev', | ||
{ | ||
props: { | ||
children: figma.children('*') | ||
}, | ||
example: (props) => <ClipboardCopy variant="inline-compact">{props.children}</ClipboardCopy> | ||
} | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"codeConnect": { | ||
"parser": "react", | ||
"include": [ | ||
"components/AboutModal/*.tsx", | ||
"components/Accordion/*.tsx", | ||
"components/ActionList/*.tsx", | ||
"components/BackgroundImage/*.tsx", | ||
"components/ClipboardCopy/*.tsx" | ||
], | ||
"paths": { | ||
"src/components": "src/components" | ||
}, | ||
"aliases": { | ||
"@patternfly/react-core": "." | ||
}, | ||
"importPaths": { | ||
"src/components": "src/components" | ||
}, | ||
"options": { | ||
"instanceSwapper": { | ||
"enabled": true | ||
}, | ||
"development": { | ||
"enabled": true, | ||
"verbose": true | ||
}, | ||
"production": { | ||
"enabled": false | ||
} | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's worth adding the
isIconList
prop here or if there is no distinction in figma. In React this boolean prop adds a class for icon-only lists that removes some additional padding.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can look for
Action icons only
, and setisIconList
based on that.