@@ -46,20 +46,23 @@ defmodule <%= @web_namespace %>.CoreComponents do
46
46
role = "alert "
47
47
class = { [
48
48
"fixed top-2 right-2 mr-2 w-80 sm:w-96 z-50 rounded-lg p-3 ring-1" ,
49
- @ kind == :info && "bg-emerald -50 text-emerald -800 ring-emerald -500 fill-cyan -900" ,
49
+ @ kind == :info && "bg-sky -50 text-sky -800 shadow-md ring-sky -500 fill-sky -900" ,
50
50
@ kind == :error && "bg-rose-50 text-rose-900 shadow-md ring-rose-500 fill-rose-900"
51
51
] }
52
52
{ @ rest }
53
53
>
54
- < p :if = { @ title } class = "flex items-center gap-1.5 text-sm font-semibold leading-6 " >
55
- < . icon :if = { @ kind == :info } name = "hero-information-circle-mini " class = "h-4 w-4 " />
56
- < . icon :if = { @ kind == :error } name = "hero-exclamation-circle-mini " class = "h-4 w-4 " />
57
- { @ title }
58
- </ p >
59
- < p class = "mt-2 text-sm leading-5 " > { msg } </ p >
60
- < button type = "button " class = "group absolute top-1 right-1 p-2 " aria-label = <%= maybe_heex_attr_gettext.( "close " , @gettext) % > >
61
- < . icon name = "hero-x-mark-solid " class = "h-5 w-5 opacity-40 group-hover:opacity-70 " />
62
- </ button >
54
+ < div class = "flex gap-2 " >
55
+ < . icon :if = { @ kind == :info } name = "hero-information-circle-mini " class = "h-5 w-5 shrink-0 " />
56
+ < . icon :if = { @ kind == :error } name = "hero-exclamation-circle-mini " class = "h-5 w-5 shrink-0 " />
57
+ < div class = "text-sm leading-5 " >
58
+ < p :if = { @ title } class = "font-semibold " > { @ title } </ p >
59
+ < p > { msg } </ p >
60
+ </ div >
61
+ < div class = "flex-1 " />
62
+ < button type = "button " class = "group flex self-start " aria-label = <%= maybe_heex_attr_gettext.( "close " , @gettext) % > >
63
+ < . icon name = "hero-x-mark-solid " class = "h-5 w-5 opacity-40 group-hover:opacity-70 " />
64
+ </ button >
65
+ </ div >
63
66
</ div >
64
67
"""
65
68
end
@@ -77,8 +80,8 @@ defmodule <%= @web_namespace %>.CoreComponents do
77
80
def flash_group ( assigns ) do
78
81
~H"""
79
82
< div id = { @ id } aria-live = "polite " >
80
- < . flash kind = { :info } title = <%= maybe_heex_attr_gettext.( " Success! " , @gettext) % > flash={ @ flash } />
81
- < .flash kind = { :error } title= <%= maybe_heex_attr_gettext . ( "Error!" , @ gettext ) %> flash={ @ flash } />
83
+ < . flash kind = { :info } flash = { @ flash } />
84
+ < . flash kind = { :error } flash = { @ flash } />
82
85
< . flash
83
86
id = "client-error "
84
87
kind = { :error }
0 commit comments