Skip to content

Commit

Permalink
Squashes button_group warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mitkins committed Nov 4, 2024
1 parent 104c5bd commit aa5ca08
Showing 1 changed file with 12 additions and 9 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

0 comments on commit aa5ca08

Please sign in to comment.