Current section

41 Versions

Jump to

Compare versions

5 files changed
+18 additions
-11 deletions
  @@ -88,8 +88,8 @@ List of available components.
88 88 - [Badge](https://daisyui.com/components/badge)
89 89 - [Bottom navigation](https://daisyui.com/components/botton-navigation)
90 90 - [Breadcrumbs](https://daisyui.com/components/breadcrumbs)
91 - - [Button group](https://daisyui.com/components/button-group) ✅ ❌
92 - - [Button](https://daisyui.com/components/button) ✅ ❌
91 + - [Button group](https://daisyui.com/components/button-group)
92 + - [Button](https://daisyui.com/components/button)
93 93 - [Card](https://daisyui.com/components/card)
94 94 - [Carousel](https://daisyui.com/components/carousel)
95 95 - [Chat bubble](https://daisyui.com/components/chat)
  @@ -42,4 +42,4 @@
42 42 {<<"optional">>,false},
43 43 {<<"repository">>,<<"hexpm">>},
44 44 {<<"requirement">>,<<"~> 0.20.14">>}]]}.
45 - {<<"version">>,<<"0.1.5">>}.
45 + {<<"version">>,<<"0.1.6">>}.
  @@ -20,8 +20,8 @@ defmodule DaisyUIComponents.Alert do
20 20
21 21 <.flash_group flash={@flash} />
22 22 """
23 - attr :flash, :map, required: true, doc: "the map of flash messages"
24 23 attr :id, :string, default: "flash-group", doc: "the optional id of flash container"
24 + attr :flash, :map, required: true, doc: "the map of flash messages"
25 25
26 26 attr :direction, :atom,
27 27 values: [:top_left, :top_right, :bottom_left, :bottom_right],
  @@ -98,7 +98,6 @@ defmodule DaisyUIComponents.Alert do
98 98 id={@id}
99 99 phx-click={JS.push("lv:clear-flash", value: %{key: @kind}) |> hide("##{@id}")}
100 100 role="alert"
101 - title={@title}
102 101 color={@color}
103 102 class={[
104 103 "w-80 sm:w-96 z-50 rounded-lg p-3 ring-1",
  @@ -110,8 +109,15 @@ defmodule DaisyUIComponents.Alert do
110 109 ]}
111 110 {@rest}
112 111 >
113 - <.icon name={get_icon(@color)} />
114 - <%= msg %>
112 + <div :if={@title} class="flex items-center">
113 + <.icon class="mr-2" name={get_icon(@color)} />
114 + <div class="flex flex-col">
115 + <h3 class="font-bold"><%= @title %></h3>
116 + <span class="text-xs"><%= msg %></span>
117 + </div>
118 + </div>
119 + <.icon :if={!@title} class="mr-2" name={get_icon(@color)} />
120 + <span :if={!@title}><%= msg %></span>
115 121 <button type="button" class="group absolute top-1 right-1 p-2" aria-label="close">
116 122 <.icon name="hero-x-mark-solid" class="h-5 w-5 opacity-40 group-hover:opacity-70" />
117 123 </button>
  @@ -119,6 +125,7 @@ defmodule DaisyUIComponents.Alert do
119 125 """
120 126 end
121 127
128 + attr :id, :string, default: nil, doc: "the optional id of alert container"
122 129 attr :class, :any, default: nil
123 130 attr :color, :string, values: ~w(info success warning error)
124 131 attr :rest, :global
  @@ -139,7 +146,7 @@ defmodule DaisyUIComponents.Alert do
139 146 )
140 147
141 148 ~H"""
142 - <div class={@class}>
149 + <div id={@id} class={@class} {@rest}>
143 150 <%= render_slot(@inner_block) %>
144 151 </div>
145 152 """
  @@ -36,8 +36,8 @@ defmodule DaisyUIComponents.Form do
36 36
37 37 ## Examples
38 38
39 - <.input field={@form[:email]} type="email" />
40 - <.input name="my-input" errors={["oh no!"]} />
39 + <.form_input field={@form[:email]} type="email" />
40 + <.form_input name="my-input" errors={["oh no!"]} />
41 41 """
42 42 attr :id, :any, default: nil
43 43 attr :name, :any
  @@ -2,7 +2,7 @@ defmodule DaisyUIComponents.MixProject do
2 2 use Mix.Project
3 3
4 4 @source_url "https://github.com/phcurado/daisy_ui_components"
5 - @version "0.1.5"
5 + @version "0.1.6"
6 6
7 7 def project do
8 8 [