Skip to content

Commit

Permalink
Merge pull request #368 from petalframework/button_group_warning
Browse files Browse the repository at this point in the history
Address Button Group warnings
  • Loading branch information
mitkins authored Nov 12, 2024
2 parents ccd34b4 + 7407b7d commit 1ae9eeb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions lib/petal_components/button_group.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,20 @@ defmodule PetalComponents.ButtonGroup do
doc: "class to customize the button border styles"

# We mark validate_attrs false so passing phx-click etc. does not emit warnings
slot :button, required: true, validate_attrs: false do
attr :class, :string, doc: "classes in addition to those already configured"
attr :label, :string, doc: "a button label, rendered if you don't provide an inner block"
slot :button, required: true, validate_attrs: false

attr :kind, :string,
values: ["button", "link"],
doc: "determines whether we render a button or a <.link />"
# :button slot attributes. Thought they're commented out, they're still relevant. It's just
# that they can't be used in a do block with `validate_attrs: false`
#
# attr :class, :string, doc: "classes in addition to those already configured"
# attr :label, :string, doc: "a button label, rendered if you don't provide an inner block"

attr :disabled, :boolean,
doc: "disables the button - will turn an <a> into a <button> (<a> tags can't be disabled)"
end
# attr :kind, :string,
# values: ["button", "link"],
# doc: "determines whether we render a button or a <.link />"

# attr :disabled, :boolean,
# doc: "disables the button - will turn an <a> into a <button> (<a> tags can't be disabled)"

def button_group(assigns) do
~H"""
Expand Down
2 changes: 1 addition & 1 deletion lib/petal_components/dropdown.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ defmodule PetalComponents.Dropdown do
<% end %>
<%= if !@label && @trigger_element == [] do %>
<.icon name="hero-ellipsis-vertical-solid" class="h-5 w-5pc-dropdown__ellipsis" />
<.icon name="hero-ellipsis-vertical-solid" class="h-5 w-5 pc-dropdown__ellipsis" />
<% end %>
</button>
</div>
Expand Down

0 comments on commit 1ae9eeb

Please sign in to comment.