diff --git a/lib/towerops_web/components/core_components.ex b/lib/towerops_web/components/core_components.ex index c7165a71..532745f9 100644 --- a/lib/towerops_web/components/core_components.ex +++ b/lib/towerops_web/components/core_components.ex @@ -8,12 +8,8 @@ defmodule ToweropsWeb.CoreComponents do with doc strings and declarative assigns. You may customize and style them in any way you want, based on your application growth and needs. - The foundation for styling is Tailwind CSS, a utility-first CSS framework, - augmented with daisyUI, a Tailwind CSS plugin that provides UI components - and themes. Here are useful references: - - * [daisyUI](https://daisyui.com/docs/intro/) - a good place to get - started and see the available components. + The foundation for styling is Tailwind CSS, a utility-first CSS framework. + Here are useful references: * [Tailwind CSS](https://tailwindcss.com) - the foundational framework we build on. You will use it for layout, sizing, flexbox, grid, and @@ -57,24 +53,62 @@ defmodule ToweropsWeb.CoreComponents do id={@id} phx-click={JS.push("lv:clear-flash", value: %{key: @kind}) |> hide("##{@id}")} role="alert" - class="toast toast-top toast-end z-50" + class="pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-50" {@rest} > -
- <.icon :if={@kind == :info} name="hero-information-circle" class="size-5 shrink-0" /> - <.icon :if={@kind == :error} name="hero-exclamation-circle" class="size-5 shrink-0" /> -
-

{@title}

-

{msg}

+
+
+
+
+
+ <.icon + :if={@kind == :info} + name="hero-information-circle" + class="h-6 w-6 text-blue-600 dark:text-blue-400" + /> + <.icon + :if={@kind == :error} + name="hero-exclamation-circle" + class="h-6 w-6 text-red-600 dark:text-red-400" + /> +
+
+

+ {@title} +

+

+ {msg} +

+
+
+ +
+
+
-
-
""" @@ -95,11 +129,19 @@ defmodule ToweropsWeb.CoreComponents do slot :inner_block, required: true def button(%{rest: rest} = assigns) do - variants = %{"primary" => "btn-primary", nil => "btn-primary btn-soft"} + variants = %{ + "primary" => + "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500 dark:bg-blue-500 dark:hover:bg-blue-600", + nil => + "bg-white text-zinc-900 ring-1 ring-inset ring-zinc-300 hover:bg-zinc-50 focus:ring-blue-500 dark:bg-zinc-800 dark:text-zinc-100 dark:ring-zinc-700 dark:hover:bg-zinc-700" + } assigns = assign_new(assigns, :class, fn -> - ["btn", Map.fetch!(variants, assigns[:variant])] + [ + "inline-flex items-center gap-2 rounded-lg px-3.5 py-2.5 text-sm font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", + Map.fetch!(variants, assigns[:variant]) + ] end) if rest[:href] || rest[:navigate] || rest[:patch] do @@ -204,8 +246,8 @@ defmodule ToweropsWeb.CoreComponents do end) ~H""" -
-