From ec5c69f43f4a284d1b21f939d5a515bf4d0fc77b Mon Sep 17 00:00:00 2001 From: nhobes Date: Wed, 30 Oct 2024 10:14:05 +1100 Subject: [PATCH] stepper wip --- lib/petal_components/stepper.ex | 30 ++-- lib/petal_components_web/a11y_live.ex | 29 ++++ test/petal/stepper_test.exs | 240 ++++++++++++++++++++++++++ 3 files changed, 287 insertions(+), 12 deletions(-) create mode 100644 test/petal/stepper_test.exs diff --git a/lib/petal_components/stepper.ex b/lib/petal_components/stepper.ex index 7254166..b5a7826 100644 --- a/lib/petal_components/stepper.ex +++ b/lib/petal_components/stepper.ex @@ -1,6 +1,5 @@ defmodule PetalComponents.Stepper do use Phoenix.Component - import Phoenix.HTML import PetalComponents.Icon attr :steps, :list, required: true @@ -10,15 +9,19 @@ defmodule PetalComponents.Stepper do def stepper(assigns) do ~H""" -
+
<%= for {step, index} <- Enum.with_index(@steps) do %> -
+
-
+
-

+

<%= step.name %>

<%= if Map.get(step, :description) do %> -

+

<%= step.description %>

<% end %> @@ -51,7 +57,7 @@ defmodule PetalComponents.Stepper do
<%= if index < length(@steps) - 1 do %> -
+