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

Address Button Group warnings #368

Merged
merged 2 commits into from
Nov 12, 2024
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
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
Loading