From aa5ca089f21d4f0c65326da71ec9fd9b3e1ee7e8 Mon Sep 17 00:00:00 2001 From: Hamish Murphy Date: Mon, 4 Nov 2024 14:55:23 +1100 Subject: [PATCH 1/2] Squashes button_group warnings --- lib/petal_components/button_group.ex | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/petal_components/button_group.ex b/lib/petal_components/button_group.ex index 530ce87..1dd783c 100644 --- a/lib/petal_components/button_group.ex +++ b/lib/petal_components/button_group.ex @@ -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 into a