-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into play/1587_group_hover_global_prop
- Loading branch information
Showing
44 changed files
with
1,418 additions
and
1,000 deletions.
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
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
37 changes: 30 additions & 7 deletions
37
playbook/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.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,13 +1,36 @@ | ||
<%= pb_rails("button", props: { text: "Open Dialog", data: {"open-dialog": "dialog-loading"} }) %> | ||
<%= pb_rails("dialog", props: { | ||
id:"dialog-loading", | ||
size: "sm", | ||
title: "Loading Exmaple", | ||
text: "Make a loading request?", | ||
cancel_button: "Cancel Button", | ||
<%= pb_rails("dialog", props: { | ||
id:"dialog-loading", | ||
size: "sm", | ||
title: "Loading Example", | ||
text: "Make a loading request?", | ||
cancel_button: "Cancel Button", | ||
cancel_button_id: "cancel-button-loading", | ||
confirm_button: "Okay", | ||
confirm_button: "Okay", | ||
confirm_button_id: "confirm-button-loading", | ||
loading: true, | ||
}) %> | ||
|
||
<script> | ||
const loadingButton = document.querySelector('[data-disable-with="Loading"]'); | ||
if (loadingButton) { | ||
loadingButton.addEventListener("click", function() { | ||
const okayLoadingButton = document.querySelector('[data-disable-with="Loading"]'); | ||
const cancelButton = document.querySelector('[data-disable-cancel-with="Loading"]'); | ||
let currentClass = okayLoadingButton.className; | ||
let cancelClass = cancelButton ? cancelButton.className : ""; | ||
|
||
setTimeout(function() { | ||
okayLoadingButton.disabled = false; | ||
okayLoadingButton.className = currentClass.replace("_disabled_loading", "_enabled"); | ||
|
||
if (cancelButton) { | ||
cancelButton.disabled = false; | ||
cancelButton.className = cancelClass.replace("_disabled", "_enabled"); | ||
} | ||
}, 5000); | ||
|
||
}); | ||
} | ||
</script> |
2 changes: 0 additions & 2 deletions
2
playbook/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md
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,3 +1 @@ | ||
Pressing the "Okay" button will trigger a loading state where the button content is replaced by a spinner icon and both buttons are disabled. | ||
|
||
Currently, the loading state cannot be undone and will require a page refresh to reset the dialog. |
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
9 changes: 9 additions & 0 deletions
9
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.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,9 @@ | ||
<% | ||
options = [ | ||
{ label: 'United States', value: 'United States', id: 'us' }, | ||
{ label: 'Canada', value: 'Canada', id: 'ca' }, | ||
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' }, | ||
] | ||
|
||
%> | ||
<%= pb_rails("dropdown", props: {options: options, separators: false}) %> |
33 changes: 33 additions & 0 deletions
33
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.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,33 @@ | ||
import React from 'react' | ||
import { Dropdown } from 'playbook-ui' | ||
|
||
const DropdownSeparatorsHidden = (props) => { | ||
|
||
const options = [ | ||
{ | ||
label: "United States", | ||
value: "United States", | ||
}, | ||
{ | ||
label: "Canada", | ||
value: "Canada", | ||
}, | ||
{ | ||
label: "Pakistan", | ||
value: "Pakistan", | ||
} | ||
]; | ||
|
||
|
||
return ( | ||
<div> | ||
<Dropdown | ||
options={options} | ||
separators={false} | ||
{...props} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default DropdownSeparatorsHidden |
10 changes: 10 additions & 0 deletions
10
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.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,10 @@ | ||
<% | ||
options = [ | ||
{ label: 'United States', value: 'United States', id: 'us' }, | ||
{ label: 'Canada', value: 'Canada', id: 'ca' }, | ||
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' }, | ||
] | ||
|
||
%> | ||
<%= pb_rails("dropdown", props: { options: options, variant: "subtle", separators: false }) %> |
34 changes: 34 additions & 0 deletions
34
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.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,34 @@ | ||
import React from 'react' | ||
import { Dropdown } from 'playbook-ui' | ||
|
||
const DropdownSubtleVariant = (props) => { | ||
|
||
const options = [ | ||
{ | ||
label: "United States", | ||
value: "United States", | ||
}, | ||
{ | ||
label: "Canada", | ||
value: "Canada", | ||
}, | ||
{ | ||
label: "Pakistan", | ||
value: "Pakistan", | ||
} | ||
]; | ||
|
||
|
||
return ( | ||
<> | ||
<Dropdown | ||
options={options} | ||
separators={false} | ||
variant="subtle" | ||
{...props} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
export default DropdownSubtleVariant |
1 change: 1 addition & 0 deletions
1
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md
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 @@ | ||
For the `subtle` variant, it is recommended that you set the `Separators` prop to `false` to remove the separator lines between the options for a more cleaner look. |
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
Oops, something went wrong.