-
Notifications
You must be signed in to change notification settings - Fork 381
feat(CC-button): added and validated button #11883
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
packages/code-connect/components/Button/BlockButton.figma.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
|
|
||
| // Block Button | ||
| figma.connect(Button, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=1259-800', { | ||
| props: { | ||
| buttonText: figma.string('Text'), | ||
| isClicked: figma.enum('State', { Clicked: true }), | ||
| isDisabled: figma.enum('State', { Disabled: true }), | ||
| iconPosition: figma.boolean('Icon at end', { true: 'end', false: undefined }) | ||
| }, | ||
| example: (props) => ( | ||
| <Button isClicked={props.isClicked} isDisabled={props.isDisabled} iconPosition={props.iconPosition} isBlock> | ||
| {props.buttonText} | ||
| </Button> | ||
| ) | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
| import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon'; | ||
|
|
||
| // Documentation for Button can be found at https://www.patternfly.org/components/button | ||
|
|
||
| figma.connect(Button, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=1259-678', { | ||
| props: { | ||
| // string | ||
| buttonText: figma.string('Text'), | ||
|
|
||
| // boolean | ||
| icon: figma.boolean('Icon at start', { | ||
| true: <ArrowRightIcon />, | ||
| false: undefined | ||
| }), | ||
| iconPosition: figma.boolean('Icon at end', { | ||
| true: 'end', | ||
| false: undefined | ||
| }), | ||
| countOptions: figma.boolean('Count', { | ||
| true: { | ||
| count: '00', | ||
| isRead: false, | ||
| className: 'custom-badge-unread' | ||
| } | ||
| }), | ||
|
|
||
| // enum | ||
| isClicked: figma.enum('State', { Clicked: true }), | ||
| id: figma.enum('Type', { | ||
| Progress: 'loading-button', | ||
| 'Secondary progress': 'loading-button' | ||
| }), | ||
| isDanger: figma.enum('Type', { | ||
| Danger: true, | ||
| 'Secondary danger': true | ||
| }), | ||
| isDisabled: figma.enum('State', { Disabled: true }), | ||
| isExpanded: figma.enum('State', { Expanded: true }), | ||
| isLoading: figma.enum('State', { | ||
| Progress: { | ||
| loadingProps: { | ||
| spinnerAriaValueText: 'Spinner aria value text', | ||
| spinnerAriaLabelledBy: 'Spinner aria labelled by', | ||
| spinnerAriaLabel: 'Spinner aria label', | ||
| isLoading: true | ||
| }, | ||
| onClick: () => {} | ||
| }, | ||
| 'Secondary progress': { | ||
| loadingProps: { | ||
| spinnerAriaValueText: 'Spinner aria value text', | ||
| spinnerAriaLabelledBy: 'Spinner aria labelled by', | ||
| spinnerAriaLabel: 'Spinner aria label', | ||
| isLoading: true | ||
| }, | ||
| onClick: () => {} | ||
| } | ||
| }), | ||
| size: figma.enum('Size', { Small: 'sm' }), | ||
| variant: figma.enum('Type', { | ||
| Primary: 'primary', | ||
| Secondary: 'secondary', | ||
| Tertiary: 'tertiary', | ||
| Warning: 'warning', | ||
| 'Secondary danger': 'secondary', | ||
| 'Secondary progress': 'secondary' | ||
| }) | ||
| }, | ||
| example: (props) => ( | ||
| <Button | ||
| countOptions={props.countOptions} | ||
| icon={props.icon} | ||
| iconPosition={props.icon} | ||
| id={props.id} | ||
| isClicked={props.isClicked} | ||
| isDisabled={props.isDisabled} | ||
| isDanger={props.isDanger} | ||
| isLoading={props.isLoading} | ||
| size={props.size} | ||
| variant={props.variant} | ||
| > | ||
| {props.buttonText} | ||
| </Button> | ||
| ) | ||
| }); | ||
23 changes: 23 additions & 0 deletions
23
packages/code-connect/components/Button/CTAButton.figma.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
| import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon'; | ||
|
|
||
| // CTA Button | ||
| figma.connect(Button, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=1259-778', { | ||
| props: { | ||
| buttonText: figma.string('Text'), | ||
| icon: figma.enum('Type', { Inline: <ArrowRightIcon /> }), | ||
| iconPosition: figma.enum('Type', { Inline: 'end' }), | ||
| variant: figma.enum('Type', { | ||
| Primary: 'primary', | ||
| Secondary: 'secondary', | ||
| Tertiary: 'tertiary', | ||
| Link: 'link' | ||
| }) | ||
| }, | ||
| example: (props) => ( | ||
| <Button icon={props.icon} iconPosition={props.iconPosition} variant={props.variant} size="lg"> | ||
| {props.buttonText} | ||
| </Button> | ||
| ) | ||
| }); |
20 changes: 20 additions & 0 deletions
20
packages/code-connect/components/Button/IconButtonPlainButton.figma.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
| import EllipsisIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon'; | ||
|
|
||
| // Icon Button | ||
| figma.connect(Button, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=1259-736', { | ||
| props: { | ||
| isClicked: figma.enum('State', { Clicked: true }), | ||
| isDisabled: figma.enum('State', { Disabled: true }), | ||
| noPadding: figma.enum('Type', { 'No padding': true }) | ||
| }, | ||
| example: (props) => ( | ||
| <Button | ||
| icon={<EllipsisIcon />} | ||
| isClicked={props.isClicked} | ||
| isDisabled={props.isDisabled} | ||
| hasNoPadding={props.noPadding} | ||
| /> | ||
| ) | ||
| }); |
27 changes: 27 additions & 0 deletions
27
packages/code-connect/components/Button/InlineLink.figma.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
|
|
||
| // Inline Link | ||
| figma.connect( | ||
| Button, | ||
| 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=1291-2153', | ||
| { | ||
| props: { | ||
| buttonText: figma.string('Text'), | ||
| isClicked: figma.enum('State', { Visited: 'clicked' }), | ||
| isDisabled: figma.enum('State', { Disabled: true }) | ||
| }, | ||
| example: (props) => ( | ||
| <Button | ||
| component="span" | ||
| isClicked={props.isClicked} | ||
| isDisabled={props.isDisabled} | ||
| isInline={true} | ||
| variant="link" | ||
| onKeyDown={() => {}} | ||
| > | ||
| {props.buttonText} | ||
| </Button> | ||
| ) | ||
| } | ||
| ); |
50 changes: 50 additions & 0 deletions
50
packages/code-connect/components/Button/LinkButton.figma.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
|
|
||
| // Link Button | ||
| figma.connect(Button, 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=1259-745', { | ||
| props: { | ||
| countOptions: figma.enum('Type', { | ||
| 'Button with count': { | ||
| count: '00', | ||
| isRead: false | ||
| } | ||
| }), | ||
| isClicked: figma.enum('State', { Clicked: true }), | ||
| isDisabled: figma.enum('State', { Disabled: true }), | ||
| isDanger: figma.enum('Type', { Danger: true }), | ||
| icon: figma.boolean('Icon at start', { | ||
| true: figma.children('IconWrapper'), | ||
| false: undefined | ||
| }), | ||
| iconPosition: figma.boolean('Icon at end', { | ||
| true: 'end', | ||
| false: undefined | ||
| }), | ||
| isLoading: figma.enum('Type', { Progress: true }), | ||
| size: figma.enum('Size', { Small: 'sm' }), | ||
| variant: figma.enum('Type', { | ||
| Primary: 'primary', | ||
| Secondary: 'secondary', | ||
| Tertiary: 'tertiary', | ||
| Warning: 'warning', | ||
| 'Secondary danger': 'secondary', | ||
| 'Secondary progress': 'secondary' | ||
| }) | ||
| }, | ||
| example: (props) => ( | ||
| <Button | ||
| countOptions={props.countOptions} | ||
| icon={props.icon} | ||
| iconPosition={props.iconPosition} | ||
| isClicked={props.isClicked} | ||
| isDisabled={props.isDisabled} | ||
| isDanger={props.isDanger} | ||
| isLoading={props.isLoading} | ||
| size={props.size} | ||
| variant={props.variant} | ||
| > | ||
| Button | ||
| </Button> | ||
| ) | ||
| }); |
28 changes: 28 additions & 0 deletions
28
packages/code-connect/components/Button/StatefulButton.figma.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import figma from '@figma/code-connect'; | ||
| import { Button } from '@patternfly/react-core'; | ||
| import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon'; | ||
|
|
||
| // Stateful Button | ||
| figma.connect( | ||
| Button, | ||
| 'https://www.figma.com/design/VMEX8Xg2nzhBX8rfBx53jp/PatternFly-6--Components?node-id=5805-20130', | ||
| { | ||
| props: { | ||
| state: figma.enum('Type', { | ||
| Read: 'read', | ||
| Unread: 'unread', | ||
| 'Unread - Needs attention': 'attention' | ||
| }), | ||
| icon: figma.boolean('Icon', { | ||
| true: <BellIcon />, | ||
| false: undefined | ||
| }), | ||
| count: figma.string('Value') | ||
| }, | ||
| example: (props) => ( | ||
| <Button icon={props.icon} state={props.state} variant="stateful"> | ||
| {props.count} <span className="pf-v6-screen-reader">items</span> | ||
| </Button> | ||
| ) | ||
| } | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this should be props.iconPosition i believe