<%= tag.details class: details_classes, open: open, **details_opts do %> <%= tag.summary class: summary_classes do %> <% if summary_content? %> <%# `` is `display: list-item`, so a flex inner div would shrink-wrap to content width and any `justify-between` inside the slot has nothing to distribute. Wrap in a `w-full` block so caller-supplied flex rows stretch across the card. %>
<%= summary_content %>
<% else %>
<% if align == :left %> <%= helpers.icon "chevron-right", class: "group-open:rotate-90 motion-safe:transition-transform motion-safe:duration-150" %> <% end %> <%= tag.span class: class_names("font-medium", align == :left ? "text-sm text-primary" : "text-xs uppercase text-secondary") do %> <%= title %> <% end %>
<% if align == :right %> <%= helpers.icon "chevron-down", class: "group-open:rotate-180 motion-safe:transition-transform motion-safe:duration-150" %> <% end %> <% end %> <% end %>
<%= content %>
<% end %>