-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add icon prop to form pills, set icon size, add tests
- Loading branch information
1 parent
c9e9590
commit 46bfc4f
Showing
6 changed files
with
47 additions
and
12 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
22 changes: 13 additions & 9 deletions
22
playbook/app/pb_kits/playbook/pb_form_pill/form_pill.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,12 +1,16 @@ | ||
<%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, tabindex: object.tabindex, **combined_html_options) do %> | ||
<% if object.name.present? %> | ||
<%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xs" }) %> | ||
<%= pb_rails("title", props: { text: object.name, size: 4, classname: "pb_form_pill_text" }) %> | ||
<% elsif object.text.present? %> | ||
<%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_form_pill_tag" }) %> | ||
<% end %> | ||
|
||
<%= pb_rails("body", props: { classname: "pb_form_pill_close" }) do %> | ||
<%= pb_rails("icon", props: { icon: 'times' , fixed_width: true }) %> | ||
<% end %> | ||
<% end %> | ||
<%= pb_rails("title", props: { text: object.name, size: 4, classname: "pb_form_pill_text" }) %> | ||
<% elsif object.text.present? %> | ||
<% if object.icon.present? %> | ||
<%= pb_rails("icon", props: { classname: "pb_form_pill_icon", icon: object.icon }) %> | ||
<% end %> | ||
<% if object.text.present? %> | ||
<%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_form_pill_tag" }) %> | ||
<% end %> | ||
<% end %> | ||
<%= pb_rails("body", props: { classname: "pb_form_pill_close" }) do %> | ||
<%= pb_rails("icon", props: { icon: 'times' , fixed_width: true }) %> | ||
<% 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