<%= render_slot(@inner_block) %>
<%= if assigns[:title_extra] do %>
<%= render_slot(@title_extra) %>
<% end %>
<%= if assigns[:action] do %>
<.ui_action_buttons action={@action}/>
<% end %>
"""
end
@section_default_border_color "gray-light"
@doc ~s"""
Render a section header with optional `action`s and `title_extra`.
## Attributes
- `class` - Set CSS classes on the outer div.
- `border` - Controls the bottom border and padding (default: true, boolean)
- `border_color` - The border color, defaults to `gray-light` resulting in `u-border-gray-light-bottom`.
- `tag` - the heading tag (defaults to h3)
- `heading_class` - Extra classes on the heading
- All other attributes are passed to the outer `div` tag.
## Attributes - `title_extra` slot
- `class` - Set CSS classes on the surrounding div.
- All other attributes are passed to the outer `div` tag.
## Attributes - `action` slots
- `class` - Set CSS classes on the surrounding `li`.
- `show` - If the action should be rendered. Defaults to `true`.
- All other attributes are passed to the outer `li` tag.
"""
story(
"Section title with default border",
'''
iex> assigns = %{}
...> render ~H"""
...> <.ui_section_title>
...> Section title
...>
...> """
''',
'''
"""
<.dynamic_tag name={@tag} class={classnames(["u-margin-0 u-margin-m-right u-break-text", assigns[:heading_class]])}>
<%= render_slot(@inner_block) %>
<%= assigns[:title_extra] && render_slot(@title_extra) %>
<%= if assigns[:action] do %>
<.ui_action_buttons action={@action}/>
<% end %>
"""
end
defp ui_action_buttons(assigns) do
~H"""