Current section

41 Versions

Jump to

Compare versions

21 files changed
+195 additions
-200 deletions
  @@ -21,7 +21,7 @@ Reference this repository on your `mix.exs` file to start using.
21 21 ```elixir
22 22 def deps do
23 23 [
24 - {:daisy_ui_components, "~> 0.3"}
24 + {:daisy_ui_components, "~> 0.4"}
25 25 ]
26 26 end
27 27 ```
  @@ -1,7 +1,7 @@
1 1 {<<"links">>,
2 2 [{<<"GitHub">>,<<"https://github.com/phcurado/daisy_ui_components">>}]}.
3 3 {<<"name">>,<<"daisy_ui_components">>}.
4 - {<<"version">>,<<"0.3.0">>}.
4 + {<<"version">>,<<"0.4.0">>}.
5 5 {<<"description">>,<<"DaisyUI component library for LiveView">>}.
6 6 {<<"elixir">>,<<"~> 1.14">>}.
7 7 {<<"app">>,<<"daisy_ui_components">>}.
  @@ -136,13 +136,11 @@ defmodule DaisyUIComponents.Alert do
136 136 assign(
137 137 assigns,
138 138 :class,
139 - join_classes(
140 - [
141 - "alert",
142 - alert_color(assigns[:color])
143 - ],
139 + classes([
140 + "alert",
141 + alert_color(assigns[:color]),
144 142 assigns.class
145 - )
143 + ])
146 144 )
147 145
148 146 ~H"""
  @@ -9,6 +9,7 @@ defmodule DaisyUIComponents.Avatar do
9 9
10 10 use DaisyUIComponents.Component
11 11
12 + attr :class, :any, default: nil
12 13 attr :online, :boolean, default: false
13 14 attr :offline, :boolean, default: false
14 15 attr :rest, :global
  @@ -16,26 +17,30 @@ defmodule DaisyUIComponents.Avatar do
16 17
17 18 def avatar(assigns) do
18 19 assigns =
19 - join_classes_with_rest(assigns, [
20 - "avatar",
21 - add_online_or_offline_class(assigns[:online], assigns[:offline])
22 - ])
20 + assign(
21 + assigns,
22 + :class,
23 + classes([
24 + "avatar",
25 + add_online_or_offline_class(assigns[:online], assigns[:offline]),
26 + assigns.class
27 + ])
28 + )
23 29
24 30 ~H"""
25 - <div {@rest}>
31 + <div class={@class} {@rest}>
26 32 {render_slot(@inner_block)}
27 33 </div>
28 34 """
29 35 end
30 36
37 + attr :class, :any, default: nil
31 38 attr :rest, :global
32 39 slot :inner_block
33 40
34 41 def avatar_group(assigns) do
35 - assigns = join_classes_with_rest(assigns, ["avatar-group"])
36 -
37 42 ~H"""
38 - <div {@rest}>
43 + <div class={classes(["avatar-group", @class])} {@rest}>
39 44 {render_slot(@inner_block)}
40 45 </div>
41 46 """
  @@ -22,7 +22,7 @@ defmodule DaisyUIComponents.Breadcrumbs do
22 22
23 23 def breadcrumbs(assigns) do
24 24 ~H"""
25 - <div class={join_classes("breadcrumbs", @class)} {@rest}>
25 + <div class={classes(["breadcrumbs", @class])} {@rest}>
26 26 <ul :if={render?(@item)}>
27 27 <%= for item <- @item do %>
28 28 <li>
Loading more files…