diff --git a/installer/templates/phx_web/components/core_components.ex b/installer/templates/phx_web/components/core_components.ex
index 8c13d42948..f5ba025411 100644
--- a/installer/templates/phx_web/components/core_components.ex
+++ b/installer/templates/phx_web/components/core_components.ex
@@ -46,20 +46,23 @@ defmodule <%= @web_namespace %>.CoreComponents do
role="alert"
class={[
"fixed top-2 right-2 mr-2 w-80 sm:w-96 z-50 rounded-lg p-3 ring-1",
- @kind == :info && "bg-emerald-50 text-emerald-800 ring-emerald-500 fill-cyan-900",
+ @kind == :info && "bg-sky-50 text-sky-800 shadow-md ring-sky-500 fill-sky-900",
@kind == :error && "bg-rose-50 text-rose-900 shadow-md ring-rose-500 fill-rose-900"
]}
{@rest}
>
-
- <.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-4 w-4" />
- <.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-4 w-4" />
- {@title}
-
- {msg}
-
+
+ <.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-5 w-5 shrink-0" />
+ <.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-5 w-5 shrink-0" />
+
+
+
+
"""
end
@@ -77,8 +80,8 @@ defmodule <%= @web_namespace %>.CoreComponents do
def flash_group(assigns) do
~H"""
- <.flash kind={:info} title=<%= maybe_heex_attr_gettext.("Success!", @gettext) %> flash={@flash} />
- <.flash kind={:error} title=<%= maybe_heex_attr_gettext.("Error!", @gettext) %> flash={@flash} />
+ <.flash kind={:info} flash={@flash} />
+ <.flash kind={:error} flash={@flash} />
<.flash
id="client-error"
kind={:error}
diff --git a/installer/test/phx_new_test.exs b/installer/test/phx_new_test.exs
index 358a396915..9690c7b66b 100644
--- a/installer/test/phx_new_test.exs
+++ b/installer/test/phx_new_test.exs
@@ -111,7 +111,7 @@ defmodule Mix.Tasks.Phx.NewTest do
assert_file("phx_blog/lib/phx_blog_web/components/core_components.ex", fn file ->
assert file =~ "defmodule PhxBlogWeb.CoreComponents"
assert file =~ ~S|aria-label={gettext("close")}|
- assert file =~ ~S|<.flash kind={:info} title={gettext("Success!")} flash={@flash} />|
+ assert file =~ ~S|gettext("Attempting to reconnect")|
end)
assert_file("phx_blog/lib/phx_blog_web/components/layouts.ex", fn file ->
@@ -567,7 +567,8 @@ defmodule Mix.Tasks.Phx.NewTest do
assert_file("phx_blog/lib/phx_blog_web/components/core_components.ex", fn file ->
assert file =~ ~S|aria-label="close"|
- assert file =~ ~S|<.flash kind={:info} title="Success!" flash={@flash} />|
+ assert file =~ ~S|Attempting to reconnect|
+ refute file =~ ~S|gettext("Attempting to reconnect")|
end)
end)
end
diff --git a/priv/templates/phx.gen.live/core_components.ex b/priv/templates/phx.gen.live/core_components.ex
index 8c13d42948..f5ba025411 100644
--- a/priv/templates/phx.gen.live/core_components.ex
+++ b/priv/templates/phx.gen.live/core_components.ex
@@ -46,20 +46,23 @@ defmodule <%= @web_namespace %>.CoreComponents do
role="alert"
class={[
"fixed top-2 right-2 mr-2 w-80 sm:w-96 z-50 rounded-lg p-3 ring-1",
- @kind == :info && "bg-emerald-50 text-emerald-800 ring-emerald-500 fill-cyan-900",
+ @kind == :info && "bg-sky-50 text-sky-800 shadow-md ring-sky-500 fill-sky-900",
@kind == :error && "bg-rose-50 text-rose-900 shadow-md ring-rose-500 fill-rose-900"
]}
{@rest}
>
-
- <.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-4 w-4" />
- <.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-4 w-4" />
- {@title}
-
-
{msg}
-
+
+ <.icon :if={@kind == :info} name="hero-information-circle-mini" class="h-5 w-5 shrink-0" />
+ <.icon :if={@kind == :error} name="hero-exclamation-circle-mini" class="h-5 w-5 shrink-0" />
+
+
+
+
"""
end
@@ -77,8 +80,8 @@ defmodule <%= @web_namespace %>.CoreComponents do
def flash_group(assigns) do
~H"""
- <.flash kind={:info} title=<%= maybe_heex_attr_gettext.("Success!", @gettext) %> flash={@flash} />
- <.flash kind={:error} title=<%= maybe_heex_attr_gettext.("Error!", @gettext) %> flash={@flash} />
+ <.flash kind={:info} flash={@flash} />
+ <.flash kind={:error} flash={@flash} />
<.flash
id="client-error"
kind={:error}