diff --git a/assets/default.css b/assets/default.css index 6da2de8..fc29ed3 100644 --- a/assets/default.css +++ b/assets/default.css @@ -612,7 +612,12 @@ :not(.phx-no-feedback).pc-form-field-wrapper--error .pc-switch .pc-switch__fake-input { - @apply bg-danger-200 border-danger-500; + @apply bg-danger-200 border-danger-500 dark:bg-danger-600 dark:border-danger-800; +} +:not(.phx-no-feedback).pc-form-field-wrapper--error + .pc-radio-card + .pc-radio-card__fake-input { + @apply bg-danger-200 dark:bg-danger-800 border-danger-500; } :not(.phx-no-feedback).pc-form-field-wrapper--error .pc-label, :not(.phx-no-feedback).pc-form-field-wrapper--error .pc-checkbox-label { @@ -732,7 +737,7 @@ } .pc-radio-card-group--row { - @apply flex-row; + @apply flex-col sm:flex-row; } .pc-radio-card-group--col { @@ -748,19 +753,15 @@ /* Apply padding to .pc-radio-card__content */ .pc-radio-card--sm > .pc-radio-card__content { - @apply p-2; + @apply px-4 py-2; } .pc-radio-card--md > .pc-radio-card__content { - @apply p-4; + @apply px-8 py-4; } .pc-radio-card--lg > .pc-radio-card__content { - @apply p-6; -} - -.pc-radio-card__icon { - @apply mb-2; + @apply px-12 py-6; } /* Adjust text size for labels */ diff --git a/lib/petal_components/field.ex b/lib/petal_components/field.ex index 24d5072..ead05f6 100644 --- a/lib/petal_components/field.ex +++ b/lib/petal_components/field.ex @@ -67,8 +67,8 @@ defmodule PetalComponents.Field do attr :label_class, :any, default: nil, doc: "extra CSS for your label" attr :selected, :any, default: nil, doc: "the selected value for select inputs" - attr :size, :string, default: nil, doc: "sm, md or lg - used by group-card" - attr :variant, :any, default: nil, doc: "outline, classic or surface - used by group-card" + attr :size, :string, default: "md", doc: "sm, md or lg - used by radio-card" + attr :variant, :any, default: "outline", doc: "outline, classic - used by radio-card" attr :required, :boolean, default: false, @@ -303,9 +303,7 @@ defmodule PetalComponents.Field do assigns = assigns |> assign_new(:checked, fn -> nil end) - |> assign_new(:size, fn -> "md" end) |> assign_new(:class, fn -> "" end) - |> assign_new(:variant, fn -> "outline" end) |> assign_new(:options, fn -> [] end) |> assign_new(:group_layout, fn -> "row" end) |> assign_new(:id_prefix, fn -> assigns.id || assigns.name || "radio_card" end) @@ -335,7 +333,8 @@ defmodule PetalComponents.Field do value={option[:value]} disabled={option[:disabled]} checked={ - to_string(option[:value]) == to_string(@value) || to_string(option[:value]) == to_string(@checked) + to_string(option[:value]) == to_string(@value) || + to_string(option[:value]) == to_string(@checked) } class="sr-only pc-radio-card__input" {@rest} @@ -343,7 +342,9 @@ defmodule PetalComponents.Field do
<%= option[:label] %>
-
<%= option[:description] %>
+
+ <%= option[:description] %> +
<% end %>