Skip to content
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

Action list allow content label #1887

Merged
merged 3 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gorgeous-zoos-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

ActionList item and divider content
2 changes: 1 addition & 1 deletion app/components/primer/alpha/action_list/divider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def initialize(scheme: DEFAULT_SCHEME, **system_arguments)
end

def call
render(Primer::BaseComponent.new(**@system_arguments)) { "" }
render(Primer::BaseComponent.new(**@system_arguments)) { content }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/components/primer/alpha/action_list/item.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<% end %>
<%= render(Primer::ConditionalWrapper.new(condition: description?, tag: :span, **@description_wrapper_arguments)) do %>
<%= render(Primer::BaseComponent.new(tag: :span, **@label_arguments)) do %>
<%= @label %>
<%= @label || content %>
<% end %>
<% if description? %>
<span class="ActionListItem-description">
Expand Down
4 changes: 2 additions & 2 deletions app/components/primer/alpha/action_list/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Item < Primer::Component

# @param list [Primer::Alpha::ActionList] The list that contains this item. Used internally.
# @param parent [Primer::Alpha::ActionList::Item] This item's parent item. `nil` if this item is at the root. Used internally.
# @param label [String] Item label.
# @param label [String] Item label. If no label is provided, content is used.
# @param label_classes [String] CSS classes that will be added to the label.
# @param label_arguments [Hash] <%= link_to_system_arguments_docs %> used to construct the label.
# @param content_arguments [Hash] <%= link_to_system_arguments_docs %> used to construct the item's anchor or button tag.
Expand All @@ -147,7 +147,7 @@ class Item < Primer::Component
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
def initialize(
list:,
label:,
label: nil,
label_classes: nil,
label_arguments: {},
content_arguments: {},
Expand Down