-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add form as a prop for button kit (#1801)
* Add form as a prop for buttons. Allows forms to be connected to a button that is created outside of the form * Add form prop to react buttons and add spec to check form prop * Add examples to the playbook kit docs for button form element in rails and react * Add spec test & optional type to form Co-authored-by: Stephen Cassidy <stephen.cassidy@powerhrg.com> Co-authored-by: Stephen Marshall <smarshall1980@gmail.com>
- Loading branch information
1 parent
9e4d38c
commit 2faef2f
Showing
8 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
playbook/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com" }) %> | ||
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com"}) %> |
1 change: 1 addition & 0 deletions
1
playbook/app/pb_kits/playbook/pb_button/docs/_button_form.html.erb
This file contains 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 @@ | ||
<%= pb_rails("button", props: { text: "Button with Form Attribute", form: "form-id"}) %> |
14 changes: 14 additions & 0 deletions
14
playbook/app/pb_kits/playbook/pb_button/docs/_button_form.jsx
This file contains 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,14 @@ | ||
import React from 'react' | ||
import { Button } from '../../' | ||
|
||
const ButtonForm = (props) => ( | ||
<div> | ||
<Button | ||
form="form-id" | ||
text="Button with Form Attribute" | ||
{...props} | ||
/> | ||
</div> | ||
) | ||
|
||
export default ButtonForm |
This file contains 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
This file contains 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
This file contains 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