-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-1420] Add "loading" variant to Circle Icon Button (#3633)
**What does this PR do?** - ✅ Expose loading prop in Circle Icon kit for underlying Button kit - ✅ Add examples and tests **Screenshots:** ![Screenshot 2024-08-26 at 9 48 19 AM](https://github.com/user-attachments/assets/368dd489-927e-4d43-940e-f474d20446aa) **How to test?** 1. Go to the Circle Icon Button kit page on Playbook 2. Review the "loading" example 3. There should be a pulse animation 4. Review both Rails and React #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [x] **TESTS** I have added test coverage to my code.
- Loading branch information
Showing
9 changed files
with
97 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
2 changes: 1 addition & 1 deletion
2
playbook/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.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,5 +1,5 @@ | ||
<%= pb_content_tag do %> | ||
<%= pb_rails("button", props: {type: object.type, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %> | ||
<%= pb_rails("button", props: {type: object.type, loading: object.loading, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %> | ||
<%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %> | ||
<% end %> | ||
<% end %> |
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
29 changes: 29 additions & 0 deletions
29
...book/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<%= pb_rails("circle_icon_button", props: { | ||
variant: "primary", | ||
icon: "plus", | ||
loading: true | ||
}) %> | ||
|
||
<br/> | ||
|
||
<%= pb_rails("circle_icon_button", props: { | ||
variant: "secondary", | ||
icon: "pen", | ||
loading: true | ||
}) %> | ||
|
||
<br/> | ||
|
||
<%= pb_rails("circle_icon_button", props: { | ||
disabled: true, | ||
icon: "times", | ||
loading: true | ||
}) %> | ||
|
||
<br/> | ||
|
||
<%= pb_rails("circle_icon_button", props: { | ||
variant: "link", | ||
icon: "user", | ||
loading: true | ||
}) %> |
43 changes: 43 additions & 0 deletions
43
playbook/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.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,43 @@ | ||
import React from 'react' | ||
|
||
import CircleIconButton from '../_circle_icon_button' | ||
|
||
const CircleIconButtonLoading = (props) => ( | ||
<div> | ||
<CircleIconButton | ||
icon="plus" | ||
loading | ||
variant="primary" | ||
{...props} | ||
/> | ||
|
||
<br /> | ||
|
||
<CircleIconButton | ||
icon="pen" | ||
loading | ||
variant="secondary" | ||
{...props} | ||
/> | ||
|
||
<br /> | ||
|
||
<CircleIconButton | ||
disabled | ||
icon="times" | ||
loading | ||
{...props} | ||
/> | ||
|
||
<br /> | ||
|
||
<CircleIconButton | ||
icon="user" | ||
loading | ||
variant="link" | ||
{...props} | ||
/> | ||
</div> | ||
) | ||
|
||
export default CircleIconButtonLoading |
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
1 change: 1 addition & 0 deletions
1
playbook/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js
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,4 @@ | ||
export { default as CircleIconButtonDefault } from './_circle_icon_button_default.jsx' | ||
export { default as CircleIconButtonClick } from './_circle_icon_button_click.jsx' | ||
export { default as CircleIconButtonLink } from './_circle_icon_button_link.jsx' | ||
export { default as CircleIconButtonLoading } from './_circle_icon_button_loading.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