From f721cd28a55f946815e1b950bc3a8eb450d97ed1 Mon Sep 17 00:00:00 2001 From: Angelika Tyborska Date: Fri, 19 Apr 2024 12:56:12 +0200 Subject: [PATCH] Transform list reset class --- lib/bitstyles_phoenix/bitstyles.ex | 10 +- .../component/breadcrumbs.ex | 95 ++++++++++++------- test/bitstyles_phoenix/bitstyles_test.exs | 2 + 3 files changed, 73 insertions(+), 34 deletions(-) diff --git a/lib/bitstyles_phoenix/bitstyles.ex b/lib/bitstyles_phoenix/bitstyles.ex index 266547c..6cacec0 100644 --- a/lib/bitstyles_phoenix/bitstyles.ex +++ b/lib/bitstyles_phoenix/bitstyles.ex @@ -31,12 +31,18 @@ defmodule BitstylesPhoenix.Bitstyles do "3xl" => "xxxl" } - mapping = + class = Enum.reduce(sizes_renaming, class, fn {new_size, old_size}, acc -> String.replace(acc, "-#{new_size}", "-#{old_size}") end) - classname(mapping, "5.0.0") + class = + case class do + "u-list-none" -> "a-list-reset" + class -> class + end + + classname(class, "5.0.0") end def classname(class, version) when version >= "4.0.0" do diff --git a/lib/bitstyles_phoenix/component/breadcrumbs.ex b/lib/bitstyles_phoenix/component/breadcrumbs.ex index 1744ae5..50942bc 100644 --- a/lib/bitstyles_phoenix/component/breadcrumbs.ex +++ b/lib/bitstyles_phoenix/component/breadcrumbs.ex @@ -40,35 +40,66 @@ defmodule BitstylesPhoenix.Component.Breadcrumbs do ...> ...> """ ''', - ''' - """ - - """ - ''', + [ + "5.0.1": ''' + """ + + """ + ''', + "4.3.0": ''' + """ + + """ + ''' + ], extra_html: """
    +
    1. Foo
        +
        1. Foo
            +
              <%= for item <- (assigns[:item] || assigns[:items]) do %>