Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Unify button and input styling across the app (#6706)

Sanne de Vries98c519304012
diff --git a/assets/css/app.css b/assets/css/app.css
index c80f0cdb2d..5d0c59786b 100644
--- a/assets/css/app.css
+++ b/assets/css/app.css
@@ -59,21 +59,21 @@
*/
.btn-base {
@apply whitespace-nowrap truncate inline-flex items-center justify-center
- gap-x-2 text-sm font-medium rounded-md cursor-pointer
+ gap-x-1.5 text-sm font-medium rounded-md cursor-pointer
disabled:cursor-not-allowed
phx-click-loading:cursor-not-allowed phx-click-loading:opacity-60;
}
.btn-xs {
- @apply px-2 py-1;
+ @apply px-2 h-8;
}
.btn-sm {
- @apply px-3 py-2;
+ @apply px-3 h-9;
}
.btn-md {
- @apply px-3.5 py-2.5;
+ @apply px-3.5 h-10;
}
.btn-theme-primary {
@@ -84,9 +84,9 @@
}
.btn-theme-secondary {
- @apply border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-700
+ @apply border border-gray-300 dark:border-gray-750 bg-white dark:bg-gray-750
text-gray-800 dark:text-gray-100 hover:bg-gray-50 hover:text-gray-900
- dark:hover:bg-gray-600 dark:hover:border-gray-600 dark:hover:text-white
+ dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:hover:text-white
disabled:text-gray-700/40 dark:disabled:text-gray-500
dark:disabled:bg-gray-800 dark:disabled:border-gray-800;
}
@@ -100,8 +100,8 @@
}
.btn-theme-danger {
- @apply border border-gray-300 dark:border-gray-800 text-red-600 bg-white
- dark:bg-gray-800 hover:text-red-700 dark:hover:text-red-400
+ @apply border border-gray-300 dark:border-gray-750 text-red-600 bg-white
+ dark:bg-gray-750 hover:text-red-700 dark:hover:text-red-400
dark:text-red-500 active:text-red-800 disabled:text-red-700/40
disabled:hover:shadow-none dark:disabled:text-red-500/35
dark:disabled:bg-gray-800;
@@ -115,27 +115,76 @@
disabled:hover:bg-transparent disabled:hover:border-transparent;
}
- .btn-theme-icon {
- @apply border border-transparent text-gray-500 dark:text-gray-400
- hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100
- dark:hover:bg-gray-800 hover:border-gray-100 dark:hover:border-gray-800
- disabled:text-gray-400 disabled:dark:text-gray-600
- disabled:hover:bg-transparent disabled:hover:border-transparent;
+ .btn-theme-link {
+ @apply border border-transparent text-gray-700 dark:text-gray-300
+ hover:text-gray-900 dark:hover:text-gray-100
+ disabled:text-gray-500 disabled:dark:text-gray-600;
+ }
+
+ .btn-icon {
+ @apply aspect-square px-0;
+ }
+
+ /* Inputs use the same size scale as buttons so the two line up side by side. */
+ .input-base {
+ @apply block text-sm text-gray-900 dark:text-white dark:bg-gray-750
+ border-gray-300 dark:border-gray-750 rounded-md transition-all duration-150
+ selection:bg-gray-200 dark:selection:bg-gray-700 focus:outline-none
+ focus:ring-3 focus:ring-indigo-500/20 dark:focus:ring-indigo-500/25
+ focus:border-indigo-500 disabled:bg-gray-100 dark:disabled:bg-gray-800
+ disabled:border-gray-200 dark:disabled:border-gray-800
+ disabled:text-gray-900/40 dark:disabled:text-white/30
+ disabled:cursor-not-allowed;
+
+ /* The mini chevron of the button triggers. A background image cannot read
+ a colour token, so gray-500 and gray-400 are hardcoded */
+ &:is(select:not([multiple])) {
+ @apply pr-10;
+
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='oklch(55.2%25 0.016 285.938)'%3e%3cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3e%3c/svg%3e");
+ background-position: right 0.875rem center;
+ background-size: 1rem 1rem;
+
+ &:where(.dark, .dark *) {
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='oklch(70.5%25 0.015 286.067)'%3e%3cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3e%3c/svg%3e");
+ }
+ }
+
+ &[readonly] {
+ @apply bg-gray-100 dark:bg-gray-800 border-transparent
+ dark:border-transparent cursor-default focus:ring-0
+ focus:border-transparent dark:focus:border-transparent;
+ }
}
- .btn-theme-icon.btn-xs {
- @apply px-1;
+ .input-sm {
+ @apply px-3 h-9;
}
- .btn-theme-icon.btn-sm {
- @apply px-2;
+ .input-md {
+ @apply px-3.5 h-10;
}
- .btn-theme-icon.btn-md {
- @apply px-2.5;
+ .input-multiline {
+ @apply h-auto py-2.5;
}
}
+@utility btn-text-primary {
+ /*
+ * Text colour is a separate axis from the theme. Utilities outrank the
+ * components layer, so these override the theme colour on any button.
+ */
+ @apply text-indigo-600 dark:text-indigo-500 hover:text-indigo-500
+ dark:hover:text-indigo-400 disabled:text-indigo-700/40
+ dark:disabled:text-indigo-500/35;
+}
+
+@utility btn-text-danger {
+ @apply text-red-600 dark:text-red-500 hover:text-red-500 dark:hover:text-red-400
+ disabled:text-red-700/40 dark:disabled:text-red-500/35;
+}
+
@theme {
/* Color aliases from tailwind.config.js */
diff --git a/assets/js/dashboard/components/button.tsx b/assets/js/dashboard/components/button.tsx
index 56d9fb7add..eb2758734a 100644
--- a/assets/js/dashboard/components/button.tsx
+++ b/assets/js/dashboard/components/button.tsx
@@ -13,12 +13,14 @@ export type ButtonTheme =
| 'danger'
| 'yellow'
| 'ghost'
- | 'icon'
+ | 'link'
export type ButtonSize = 'xs' | 'sm' | 'md'
const buttonBaseClass = 'btn-base'
+const buttonIconClass = 'btn-icon'
+
const buttonSizes: Record<ButtonSize, string> = {
xs: 'btn-xs',
sm: 'btn-sm',
@@ -31,35 +33,45 @@ const buttonThemes: Record<ButtonTheme, string> = {
yellow: 'btn-theme-yellow',
danger: 'btn-theme-danger',
ghost: 'btn-theme-ghost',
- icon: 'btn-theme-icon'
+ link: 'btn-theme-link'
}
export const buttonClassName = ({
theme = 'primary',
size = 'md',
+ icon = false,
className
}: {
theme?: ButtonTheme
size?: ButtonSize
+ icon?: boolean
className?: string
} = {}): string =>
- classNames(buttonBaseClass, buttonSizes[size], buttonThemes[theme], className)
+ classNames(
+ buttonBaseClass,
+ buttonSizes[size],
+ buttonThemes[theme],
+ icon && buttonIconClass,
+ className
+ )
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
theme?: ButtonTheme
size?: ButtonSize
+ icon?: boolean
}
export const Button = ({
theme = 'primary',
size = 'md',
+ icon = false,
type = 'button',
className,
...rest
}: ButtonProps) => (
<button
type={type}
- className={buttonClassName({ theme, size, className })}
+ className={buttonClassName({ theme, size, icon, className })}
{...rest}
/>
)
diff --git a/extra/lib/plausible_web/live/customer_support/team/components/members.ex b/extra/lib/plausible_web/live/customer_support/team/components/members.ex
index bbc22de8ee..433a2390ef 100644
--- a/extra/lib/plausible_web/live/customer_support/team/components/members.ex
+++ b/extra/lib/plausible_web/live/customer_support/team/components/members.ex
@@ -49,16 +49,21 @@ defmodule PlausibleWeb.CustomerSupport.Team.Components.Members do
<div class="flex items-center gap-x-1">
<span :if={member.type == :membership && member.meta.user.type == :sso}>SSO </span>{member.type}
- <.delete_button
+ <.button
:if={member.type == :membership && member.meta.user.type == :sso}
id={"deprovision-sso-user-#{member.id}"}
+ theme="ghost"
+ size="sm"
+ icon?={true}
+ mt?={false}
+ class="btn-text-danger"
phx-click="deprovision-sso-user"
phx-value-identifier={member.id}
phx-target={@myself}
- class="text-sm"
- icon={:user_minus}
data-confirm="Are you sure you want to deprovision SSO user and convert them to a standard user? This will sign them out and force to use regular e-mail/password combination to log in again."
- />
+ >
+ <Heroicons.user_minus class="size-4" />
+ </.button>
</div>
</.td>
<.td>
diff --git a/extra/lib/plausible_web/live/customer_support/team/components/sso.ex b/extra/lib/plausible_web/live/customer_support/team/components/sso.ex
index 112993f76c..2a0b374ef3 100644
--- a/extra/lib/plausible_web/live/customer_support/team/components/sso.ex
+++ b/extra/lib/plausible_web/live/customer_support/team/components/sso.ex
@@ -55,7 +55,6 @@ defmodule PlausibleWeb.CustomerSupport.Team.Components.SSO do
phx-click="remove-sso-domain"
phx-value-identifier={sso_domain.identifier}
phx-target={@myself}
- class="text-sm text-red-600"
data-confirm={"Are you sure you want to remove domain '#{sso_domain.domain}'? All SSO users will be deprovisioned and logged out."}
/>
</.td>
diff --git a/extra/lib/plausible_web/live/funnel_settings/list.ex b/extra/lib/plausible_web/live/funnel_settings/list.ex
index 0e52c5ce31..1968edd485 100644
--- a/extra/lib/plausible_web/live/funnel_settings/list.ex
+++ b/extra/lib/plausible_web/live/funnel_settings/list.ex
@@ -39,7 +39,6 @@ defmodule PlausibleWeb.Live.FunnelSettings.List do
id={"delete-funnel-#{funnel.id}"}
phx-click="delete-funnel"
phx-value-funnel-id={funnel.id}
- class="text-sm text-red-600"
data-confirm={"Are you sure you want to remove funnel '#{funnel.name}'? This will just affect the UI, all of your analytics data will stay intact."}
/>
</.td>
diff --git a/extra/lib/plausible_web/live/sso_management.ex b/extra/lib/plausible_web/live/sso_management.ex
index 9b81f58835..41536561eb 100644
--- a/extra/lib/plausible_web/live/sso_management.ex
+++ b/extra/lib/plausible_web/live/sso_management.ex
@@ -360,14 +360,12 @@ defmodule PlausibleWeb.Live.SSOManagement do
id={"remove-domain-#{domain.identifier}"}
phx-click="remove-domain"
phx-value-identifier={domain.identifier}
- class="text-sm text-red-600"
data-confirm={"Are you sure you want to remove domain '#{domain.domain}'?"}
/>
<.delete_button
:if={@domain_delete_checks[domain.identifier]}
id={"disabled-remove-domain-#{domain.identifier}"}
- class="text-sm text-red-600"
data-confirm={"You cannot delete this domain. #{@domain_delete_checks[domain.identifier]}"}
/>
</.td>
diff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.ex
index 9f34557667..7e195ab592 100644
--- a/lib/plausible_web/components/generic.ex
+++ b/lib/plausible_web/components/generic.ex
@@ -56,11 +56,13 @@ defmodule PlausibleWeb.Components.Generic do
"yellow" => "btn-theme-yellow",
"danger" => "btn-theme-danger",
"ghost" => "btn-theme-ghost",
- "icon" => "btn-theme-icon"
+ "link" => "btn-theme-link"
}
@button_base_class "btn-base"
+ @button_icon_class "btn-icon"
+
@button_sizes %{
"xs" => "btn-xs",
"sm" => "btn-sm",
@@ -81,6 +83,7 @@ defmodule PlausibleWeb.Components.Generic do
attr(:type, :string, default: "button")
attr(:theme, :string, default: "primary")
attr(:size, :string, default: "md")
+ attr(:icon?, :boolean, default: false)
attr(:class, :string, default: "")
attr(:disabled, :boolean, default: false)
attr(:mt?, :boolean, default: true)
@@ -93,7 +96,8 @@ defmodule PlausibleWeb.Components.Generic do
assign(assigns,
button_base_class: @button_base_class,
theme_class: @button_themes[assigns.theme],
- size_class: @button_sizes[assigns.size]
+ size_class: @button_sizes[assigns.size],
+ icon_class: assigns.icon? && @button_icon_class
)
~H"""
@@ -105,6 +109,7 @@ defmodule PlausibleWeb.Components.Generic do
@button_base_class,
@size_class,
@theme_class,
+ @icon_class,
@class
]}
{@rest}
@@ -118,6 +123,7 @@ defmodule PlausibleWeb.Components.Generic do
attr(:class, :string, default: "")
attr(:theme, :string, default: "primary")
attr(:size, :string, default: "md")
+ attr(:icon?, :boolean, default: false)
attr(:disabled, :boolean, default: false)
attr(:method, :string, default: "get")
attr(:mt?, :boolean, default: true)
@@ -158,7 +164,8 @@ defmodule PlausibleWeb.Components.Generic do
onclick: onclick,
button_base_class: @button_base_class,
theme_class: theme_class,
- size_class: @button_sizes[assigns.size]
+ size_class: @button_sizes[assigns.size],
+ icon_class: assigns.icon? && @button_icon_class
)
~H"""
@@ -170,6 +177,7 @@ defmodule PlausibleWeb.Components.Generic do
@button_base_class,
@size_class,
@theme_class,
+ @icon_class,
@class
]}
{@extra}
@@ -329,6 +337,8 @@ defmodule PlausibleWeb.Components.Generic do
slot :button, required: true do
attr(:class, :string)
+ attr(:theme, :string)
+ attr(:size, :string)
end
slot :menu, required: true do
@@ -336,7 +346,16 @@ defmodule PlausibleWeb.Components.Generic do
end
def dropdown(assigns) do
- assigns = assign(assigns, :menu_class, assigns.menu |> List.first() |> Map.get(:class, ""))
+ button = List.first(assigns.button)
+
+ assigns =
+ assign(assigns,
+ menu_class: assigns.menu |> List.first() |> Map.get(:class, ""),
+ button: button,
+ button_class: Map.get(button, :class, ""),
+ button_theme: Map.get(button, :theme, "secondary"),
+ button_size: Map.get(button, :size, "md")
+ )
~H"""
<div
@@ -345,14 +364,17 @@ defmodule PlausibleWeb.Components.Generic do
x-on:keydown.escape.prevent.stop="close($refs.button)"
class="relative inline-block text-left"
>
- <button
+ <.button
+ id={"#{@id}-button"}
x-ref="button"
x-on:click="toggle()"
- type="button"
- class={["py-2.5", List.first(@button).class]}
+ theme={@button_theme}
+ size={@button_size}
+ mt?={false}
+ class={@button_class}
>
- {render_slot(List.first(@button))}
- </button>
+ {render_slot(@button)}
+ </.button>
<div
x-show="open"
x-cloak
@@ -934,14 +956,14 @@ defmodule PlausibleWeb.Components.Generic do
"overflow-visible",
@truncate && "truncate",
@max_width,
- @actions && "flex text-right justify-end",
+ @actions && "flex items-center text-right justify-end",
@hide_on_mobile && "hidden md:table-cell",
@class
]
}
{@rest}
>
- <div :if={@actions} class="flex gap-1">
+ <div :if={@actions} class="flex items-center gap-1">
{render_slot(@inner_block)}
</div>
<div :if={!@actions}>
@@ -1010,153 +1032,53 @@ defmodule PlausibleWeb.Components.Generic do
"""
end
- attr :href, :string, required: false
- attr :icon_name, :atom, required: false
- attr :theme, :string, default: "default"
attr :class, :string, default: ""
- attr :icon_class, :string, default: ""
- attr :size, :string, default: "4"
- attr :rest, :global, include: ~w(method disabled)
-
- slot :inner_block, required: false
-
- def icon_button(assigns) do
- icon_source =
- case {assigns.inner_block, assigns[:icon_name]} do
- {[], nil} ->
- raise ArgumentError,
- "Either `icon_name` attribute or icon inner block must be provided"
-
- {[_ | _], icon_name} when not is_nil(icon_name) ->
- raise ArgumentError, "Only one of `icon_name` and icon inner block must be provided"
-
- {[_ | _], nil} ->
- :inner_block
-
- {[], icon_name} when not is_nil(icon_name) ->
- :icon_name
- end
-
- text =
- case assigns.theme do
- "default" ->
- %{
- light: "text-indigo-700",
- light_hover: "text-indigo-600",
- dark: "text-indigo-500",
- dark_hover: "text-indigo-400"
- }
-
- "danger" ->
- %{
- light: "text-red-700",
- light_hover: "text-red-500",
- dark: "text-red-500",
- dark_hover: "text-red-400"
- }
-
- _ ->
- raise ArgumentError, "Invalid `theme` provided"
- end
-
- button_class = [
- "group/button",
- "w-fit h-fit",
- "p-2",
- "hover:bg-gray-100",
- "dark:hover:bg-gray-800",
- "rounded-md",
- "transition-colors",
- "duration-150",
- assigns.class
- ]
-
- icon_class = [
- "size-#{assigns.size}",
- text.light,
- "group-hover/button:" <> text.light_hover,
- "dark:" <> text.dark,
- "dark:group-hover/button:" <> text.dark_hover,
- "transition-colors",
- "duration-150",
- "group-disabled/button:opacity-50",
- assigns.icon_class
- ]
-
- assigns =
- assigns
- |> assign(:icon_source, icon_source)
- |> assign(:button_class, button_class)
- |> assign(:icon_class, icon_class)
-
- if assigns[:href] do
- ~H"""
- <.unstyled_link href={@href} class={@button_class} {@rest}>
- <span :if={@icon_source == :inner_block}>
- {render_slot(@inner_block, @icon_class)}
- </span>
- <.dynamic_icon
- :if={@icon_source == :icon_name}
- name={@icon_name}
- class={@icon_class}
- />
- </.unstyled_link>
- """
- else
- ~H"""
- <button class={@button_class} {@rest}>
- <span :if={@icon_source == :inner_block}>
- {render_slot(@inner_block, @icon_class)}
- </span>
- <.dynamic_icon
- :if={@icon_source == :icon_name}
- name={@icon_name}
- class={@icon_class}
- />
- </button>
- """
- end
- end
-
- attr :href, :string, default: nil
- attr :class, :string, default: ""
- attr :rest, :global, include: ~w(method disabled)
+ attr :rest, :global, include: ~w(disabled)
def edit_button(assigns) do
~H"""
- <.icon_button :let={icon_class} href={@href} class={@class} {@rest}>
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 24"
- class={icon_class}
- >
- <path
- stroke="currentColor"
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="1.5"
- d="m13.25 6.25 2.836-2.836a2 2 0 0 1 2.828 0l1.672 1.672a2 2 0 0 1 0 2.828L17.75 10.75m-4.5-4.5-9.914 9.914a2 2 0 0 0-.586 1.415v3.671h3.672a2 2 0 0 0 1.414-.586l9.914-9.914m-4.5-4.5 4.5 4.5"
- />
- </svg>
- </.icon_button>
+ <.button
+ theme="ghost"
+ size="sm"
+ icon?={true}
+ mt?={false}
+ class={"btn-text-primary #{@class}"}
+ {@rest}
+ >
+ <.pencil_icon class="size-4" />
+ </.button>
"""
end
attr :href, :string, default: nil
attr :class, :string, default: ""
- attr :icon, :atom, default: :trash
attr :rest, :global, include: ~w(method disabled)
def delete_button(assigns) do
~H"""
- <.icon_button
- icon_name={@icon}
- theme="danger"
- class={@class}
+ <.button_link
+ :if={@href}
href={@href}
+ theme="ghost"
+ size="sm"
+ icon?={true}
+ mt?={false}
+ class={"btn-text-danger #{@class}"}
{@rest}
- />
+ >
+ <Heroicons.trash class="size-4" />
+ </.button_link>
+ <.button
+ :if={is_nil(@href)}
+ theme="ghost"
+ size="sm"
+ icon?={true}
+ mt?={false}
+ class={"btn-text-danger #{@class}"}
+ {@rest}
+ >
+ <Heroicons.trash class="size-4" />
+ </.button>
"""
end
@@ -1183,7 +1105,7 @@ defmodule PlausibleWeb.Components.Generic do
type="text"
name="filter-text"
id="filter-text"
- class="w-full max-w-80 pl-8 pr-3.5 py-2.5 text-sm dark:bg-gray-750 dark:text-gray-300 focus:ring-indigo-500 focus:border-indigo-500 block border-gray-300 dark:border-gray-750 rounded-md dark:placeholder:text-gray-400 focus:outline-none focus:ring-3 focus:ring-indigo-500/20 dark:focus:ring-indigo-500/25 focus:border-indigo-500"
+ class="input-base input-md w-full max-w-80 pl-8 dark:text-gray-300 dark:placeholder:text-gray-400"
placeholder="Press / to search"
x-ref="filter_text"
phx-debounce={200}
diff --git a/lib/plausible_web/components/google.ex b/lib/plausible_web/components/google.ex
index bd8767f954..61907f531e 100644
--- a/lib/plausible_web/components/google.ex
+++ b/lib/plausible_web/components/google.ex
@@ -9,58 +9,38 @@ defmodule PlausibleWeb.Components.Google do
def button(assigns) do
~H"""
- <.unstyled_link
- id={@id}
- href={@to}
- class="inline-flex pr-4 items-center border border-gray-100 shadow-sm rounded-md focus:outline-hidden focus:ring-1 focus:ring-offset-1 focus:ring-gray-200 mt-8 hover:bg-gray-50 dark:hover:bg-gray-700"
- >
- <.logo />
- <span
- style="font-family: Roboto, system-ui"
- class="text-sm font-medium text-gray-600 dark:text-gray-50"
- >
- Continue with Google
- </span>
- </.unstyled_link>
+ <.button_link id={@id} href={@to} theme="secondary" mt?={false}>
+ <.logo /> Continue with Google
+ </.button_link>
"""
end
- def logo(assigns \\ %{}) do
+ attr(:class, :string, default: "size-4")
+
+ def logo(assigns) do
~H"""
- <svg
- width="46px"
- height="46px"
- viewBox="0 0 46 46"
- version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- >
+ <svg class={@class} viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
- <g transform="translate(-1.000000, -1.000000)">
- <g transform="translate(15.000000, 15.000000)">
- <path
- d="M17.64,9.20454545 C17.64,8.56636364 17.5827273,7.95272727 17.4763636,7.36363636 L9,7.36363636 L9,10.845 L13.8436364,10.845 C13.635,11.97 13.0009091,12.9231818 12.0477273,13.5613636 L12.0477273,15.8195455 L14.9563636,15.8195455 C16.6581818,14.2527273 17.64,11.9454545 17.64,9.20454545 L17.64,9.20454545 Z"
- fill="#4285F4"
- >
- </path>
- <path
- d="M9,18 C11.43,18 13.4672727,17.1940909 14.9563636,15.8195455 L12.0477273,13.5613636 C11.2418182,14.1013636 10.2109091,14.4204545 9,14.4204545 C6.65590909,14.4204545 4.67181818,12.8372727 3.96409091,10.71 L0.957272727,10.71 L0.957272727,13.0418182 C2.43818182,15.9831818 5.48181818,18 9,18 L9,18 Z"
- fill="#34A853"
- >
- </path>
- <path
- d="M3.96409091,10.71 C3.78409091,10.17 3.68181818,9.59318182 3.68181818,9 C3.68181818,8.40681818 3.78409091,7.83 3.96409091,7.29 L3.96409091,4.95818182 L0.957272727,4.95818182 C0.347727273,6.17318182 0,7.54772727 0,9 C0,10.4522727 0.347727273,11.8268182 0.957272727,13.0418182 L3.96409091,10.71 L3.96409091,10.71 Z"
- fill="#FBBC05"
- >
- </path>
- <path
- d="M9,3.57954545 C10.3213636,3.57954545 11.5077273,4.03363636 12.4404545,4.92545455 L15.0218182,2.34409091 C13.4631818,0.891818182 11.4259091,0 9,0 C5.48181818,0 2.43818182,2.01681818 0.957272727,4.95818182 L3.96409091,7.29 C4.67181818,5.16272727 6.65590909,3.57954545 9,3.57954545 L9,3.57954545 Z"
- fill="#EA4335"
- >
- </path>
- <path d="M0,0 L18,0 L18,18 L0,18 L0,0 Z"></path>
- </g>
- </g>
+ <path
+ d="M17.64,9.20454545 C17.64,8.56636364 17.5827273,7.95272727 17.4763636,7.36363636 L9,7.36363636 L9,10.845 L13.8436364,10.845 C13.635,11.97 13.0009091,12.9231818 12.0477273,13.5613636 L12.0477273,15.8195455 L14.9563636,15.8195455 C16.6581818,14.2527273 17.64,11.9454545 17.64,9.20454545 L17.64,9.20454545 Z"
+ fill="#4285F4"
+ >
+ </path>
+ <path
+ d="M9,18 C11.43,18 13.4672727,17.1940909 14.9563636,15.8195455 L12.0477273,13.5613636 C11.2418182,14.1013636 10.2109091,14.4204545 9,14.4204545 C6.65590909,14.4204545 4.67181818,12.8372727 3.96409091,10.71 L0.957272727,10.71 L0.957272727,13.0418182 C2.43818182,15.9831818 5.48181818,18 9,18 L9,18 Z"
+ fill="#34A853"
+ >
+ </path>
+ <path
+ d="M3.96409091,10.71 C3.78409091,10.17 3.68181818,9.59318182 3.68181818,9 C3.68181818,8.40681818 3.78409091,7.83 3.96409091,7.29 L3.96409091,4.95818182 L0.957272727,4.95818182 C0.347727273,6.17318182 0,7.54772727 0,9 C0,10.4522727 0.347727273,11.8268182 0.957272727,13.0418182 L3.96409091,10.71 L3.96409091,10.71 Z"
+ fill="#FBBC05"
+ >
+ </path>
+ <path
+ d="M9,3.57954545 C10.3213636,3.57954545 11.5077273,4.03363636 12.4404545,4.92545455 L15.0218182,2.34409091 C13.4631818,0.891818182 11.4259091,0 9,0 C5.48181818,0 2.43818182,2.01681818 0.957272727,4.95818182 L3.96409091,7.29 C4.67181818,5.16272727 6.65590909,3.57954545 9,3.57954545 L9,3.57954545 Z"
+ fill="#EA4335"
+ >
+ </path>
</g>
</svg>
"""
diff --git a/lib/plausible_web/components/layouts/header.html.heex b/lib/plausible_web/components/layouts/header.html.heex
index 233fb42659..3086bdbca7 100644
--- a/lib/plausible_web/components/layouts/header.html.heex
+++ b/lib/plausible_web/components/layouts/header.html.heex
@@ -7,166 +7,145 @@
</a>
</div>
<div class="absolute inset-y-0 right-0 flex items-center justify-end">
- <%= cond do %>
- <% @current_user -> %>
- <ul class="flex items-center gap-2 w-full sm:w-auto">
- <li :if={
- ee?() && @site &&
- Plausible.Auth.super_admin?(@current_user)
- }>
+ <%= if @current_user do %>
+ <ul class="flex items-center gap-2 w-full sm:w-auto">
+ <li :if={
+ ee?() && @site &&
+ Plausible.Auth.super_admin?(@current_user)
+ }>
+ <.styled_link
+ class="text-sm font-medium"
+ href={"/cs/sites/site/#{@site.id}"}
+ new_tab={true}
+ >
+ CS
+ </.styled_link>
+ </li>
+ <li
+ :if={
+ ee?() and Plausible.Teams.on_trial?(@current_team) and
+ (not Plausible.Teams.setup?(@current_team) or
+ @current_team_role in Plausible.Billing.allowed_roles()) and
+ @trial_badge?
+ }
+ class="hidden sm:block"
+ >
+ <div class="flex items-center gap-x-2 px-3.5 py-2 rounded-lg bg-gradient-to-r from-indigo-100 to-purple-100 dark:from-indigo-600/35 dark:to-purple-600/35 overflow-hidden">
+ <span class="text-sm font-medium text-gray-900 dark:text-gray-100">
+ {PlausibleWeb.LayoutView.trial_notification(@current_team)}
+ </span>
+ <div class="w-px h-4 bg-indigo-500/30 dark:bg-indigo-200/30" aria-hidden="true">
+ </div>
<.styled_link
- class="text-sm font-medium"
- href={"/cs/sites/site/#{@site.id}"}
- new_tab={true}
+ href={~p"/settings/billing/subscription"}
+ class="plausible-event-name=Trial+Notification+Upgrade+Click text-sm font-medium dark:!text-indigo-400 dark:hover:!text-indigo-300"
>
- CS
+ Choose a plan
</.styled_link>
- </li>
- <li
- :if={
- ee?() and Plausible.Teams.on_trial?(@current_team) and
- (not Plausible.Teams.setup?(@current_team) or
- @current_team_role in Plausible.Billing.allowed_roles()) and
- @trial_badge?
- }
- class="hidden sm:block"
- >
- <div class="flex items-center gap-x-2 px-3.5 py-2 rounded-lg bg-gradient-to-r from-indigo-100 to-purple-100 dark:from-indigo-600/35 dark:to-purple-600/35 overflow-hidden">
- <span class="text-sm font-medium text-gray-900 dark:text-gray-100">
- {PlausibleWeb.LayoutView.trial_notification(@current_team)}
+ </div>
+ </li>
+ <li class="w-full sm:w-auto">
+ <.dropdown>
+ <:button theme="ghost" size="sm" class="pr-1.5">
+ <span class="hidden md:block text-sm font-medium truncate dark:text-gray-100">
+ {@current_user.name}
</span>
- <div class="w-px h-4 bg-indigo-500/30 dark:bg-indigo-200/30" aria-hidden="true">
- </div>
- <.styled_link
- href={~p"/settings/billing/subscription"}
- class="plausible-event-name=Trial+Notification+Upgrade+Click text-sm font-medium dark:!text-indigo-400 dark:hover:!text-indigo-300"
- >
- Choose a plan
- </.styled_link>
- </div>
- </li>
- <li class="w-full sm:w-auto">
- <.dropdown>
- <:button class="flex items-center gap-2 pl-3 pr-1.5 py-2 rounded-md transition-colors duration-150 hover:bg-gray-100 dark:hover:bg-gray-800">
- <span class="hidden md:block text-sm font-medium truncate dark:text-gray-100">
- {@current_user.name}
- </span>
- <img
- src={Plausible.Auth.User.profile_img_url(@current_user)}
- class="-my-0.5 w-7 rounded-full"
- />
- </:button>
- <:menu class="max-w-xs">
- <.dropdown_item>
- <div class="text-xs text-gray-500 dark:text-gray-400">Signed in as</div>
- <p class="truncate font-medium text-gray-900 dark:text-gray-100" role="none">
- {@current_user.email}
- </p>
- </.dropdown_item>
- <PlausibleWeb.LayoutView.team_switcher
- teams={@teams}
- my_team={@my_team}
- current_team={@current_team}
- />
- <.dropdown_divider />
- <.dropdown_item href={~p"/settings"}>
- Account settings
- </.dropdown_item>
-
- <div :if={@my_team && @my_team.id == @current_team.id}>
- <.dropdown_item
- class="flex"
- href={~p"/team/setup"}
- >
- <span data-test="create-a-team-cta" class="flex-1">
- Create a team
- </span>
- </.dropdown_item>
- <.dropdown_divider />
- </div>
+ <img
+ src={Plausible.Auth.User.profile_img_url(@current_user)}
+ class="size-6 rounded-full"
+ />
+ </:button>
+ <:menu class="max-w-xs">
+ <.dropdown_item>
+ <div class="text-xs text-gray-500 dark:text-gray-400">Signed in as</div>
+ <p class="truncate font-medium text-gray-900 dark:text-gray-100" role="none">
+ {@current_user.email}
+ </p>
+ </.dropdown_item>
+ <PlausibleWeb.LayoutView.team_switcher
+ teams={@teams}
+ my_team={@my_team}
+ current_team={@current_team}
+ />
+ <.dropdown_divider />
+ <.dropdown_item href={~p"/settings"}>
+ Account settings
+ </.dropdown_item>
- <div :if={Plausible.Teams.setup?(@current_team)}>
- <.dropdown_item
- class="flex"
- href={~p"/settings/team/general"}
- >
- <span class="flex-1">
- Team settings
- </span>
- </.dropdown_item>
- <.dropdown_divider />
- </div>
- <.dropdown_item
- class="!flex justify-between gap-x-12"
- new_tab
- href="https://plausible.io/docs"
- >
- Help center
- </.dropdown_item>
+ <div :if={@my_team && @my_team.id == @current_team.id}>
<.dropdown_item
- :if={ee?()}
- class="!flex justify-between gap-x-12"
- new_tab
- href="https://plausible.io/contact"
+ class="flex"
+ href={~p"/team/setup"}
>
- Contact support
- </.dropdown_item>
- <.dropdown_item
- :if={ee?()}
- class="!flex justify-between gap-x-12"
- new_tab
- href={PlausibleWeb.LayoutView.feedback_link(@current_user)}
- >
- Feature requests
+ <span data-test="create-a-team-cta" class="flex-1">
+ Create a team
+ </span>
</.dropdown_item>
+ <.dropdown_divider />
+ </div>
+
+ <div :if={Plausible.Teams.setup?(@current_team)}>
<.dropdown_item
- :if={ce?()}
- class="!flex justify-between gap-x-12"
- new_tab
- href="https://github.com/plausible/analytics"
+ class="flex"
+ href={~p"/settings/team/general"}
>
- Github repo
+ <span class="flex-1">
+ Team settings
+ </span>
</.dropdown_item>
- <.dropdown_item href="/logout">Log out</.dropdown_item>
- </:menu>
- </.dropdown>
- </li>
- <li :if={ee?()} id="changelog-notification" class="relative py-2 empty:hidden"></li>
- </ul>
- <% Plausible.Auth.check_registration_enabled() != :ok -> %>
- <ul class="flex" x-show="!document.cookie.includes('logged_in=true')">
- <li>
- <div class="inline-flex">
- <a
- href="/login"
- class="font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 focus:outline-hidden focus:text-gray-900 transition duration-150 ease-in-out"
+ <.dropdown_divider />
+ </div>
+ <.dropdown_item
+ class="!flex justify-between gap-x-12"
+ new_tab
+ href="https://plausible.io/docs"
>
- Login
- </a>
- </div>
- </li>
- </ul>
- <% true -> %>
- <ul class="flex" x-show="!document.cookie.includes('logged_in=true')">
- <li>
- <div class="inline-flex">
- <a
- href="/login"
- class="font-medium text-gray-500 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100 focus:outline-hidden focus:text-gray-900 transition duration-150 ease-in-out"
+ Help center
+ </.dropdown_item>
+ <.dropdown_item
+ :if={ee?()}
+ class="!flex justify-between gap-x-12"
+ new_tab
+ href="https://plausible.io/contact"
>
- Login
- </a>
- </div>
- <div class="inline-flex ml-6 rounded-sm shadow-sm">
- <a
- href="/register"
- class="inline-flex items-center justify-center px-5 py-2 text-base font-medium text-white bg-indigo-600 border border-transparent leading-6 rounded-md hover:bg-indigo-500 focus:outline-hidden focus:ring transition duration-150 ease-in-out"
+ Contact support
+ </.dropdown_item>
+ <.dropdown_item
+ :if={ee?()}
+ class="!flex justify-between gap-x-12"
+ new_tab
+ href={PlausibleWeb.LayoutView.feedback_link(@current_user)}
>
- Sign up
- </a>
- </div>
- </li>
- </ul>
+ Feature requests
+ </.dropdown_item>
+ <.dropdown_item
+ :if={ce?()}
+ class="!flex justify-between gap-x-12"
+ new_tab
+ href="https://github.com/plausible/analytics"
+ >
+ Github repo
+ </.dropdown_item>
+ <.dropdown_item href="/logout">Log out</.dropdown_item>
+ </:menu>
+ </.dropdown>
+ </li>
+ <li :if={ee?()} id="changelog-notification" class="relative py-2 empty:hidden"></li>
+ </ul>
+ <% else %>
+ <div
+ class="flex items-center gap-2"
+ x-show="!document.cookie.includes('logged_in=true')"
+ >
+ <.button_link href="/login" theme="ghost" mt?={false}>Login</.button_link>
+ <.button_link
+ :if={Plausible.Auth.check_registration_enabled() == :ok}
+ href="/register"
+ mt?={false}
+ >
+ Sign up
+ </.button_link>
+ </div>
<% end %>
</div>
</nav>
diff --git a/lib/plausible_web/components/prima_dropdown.ex b/lib/plausible_web/components/prima_dropdown.ex
index 47f506be18..2e30da8393 100644
--- a/lib/plausible_web/components/prima_dropdown.ex
+++ b/lib/plausible_web/components/prima_dropdown.ex
@@ -5,20 +5,24 @@ defmodule PlausibleWeb.Components.PrimaDropdown do
@dropdown_item_icon_base_class "text-gray-600 dark:text-gray-400 group-hover/item:text-gray-900 group-data-focus/item:text-gray-900 dark:group-hover/item:text-gray-100 dark:group-data-focus/item:text-gray-100"
- @trigger_button_base_class "whitespace-nowrap truncate inline-flex items-center justify-between gap-x-2 text-sm font-medium rounded-md cursor-pointer disabled:cursor-not-allowed"
+ # Themes/sizes/base are defined as component classes in
+ # assets/css/app.css, shared with the Phoenix `button` component
+ # (lib/plausible_web/components/generic.ex). Update there only.
+ @trigger_base_class "btn-base focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
- @trigger_button_themes %{
- "primary" =>
- "border border-indigo-600 bg-indigo-600 text-white hover:bg-indigo-700 focus-visible:outline-indigo-600 disabled:bg-indigo-400/60 disabled:dark:bg-indigo-600/30 disabled:dark:text-white/35",
- "secondary" =>
- "border border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-700 text-gray-800 dark:text-gray-100 hover:border-gray-400/60 hover:text-gray-900 dark:hover:border-gray-500 dark:hover:text-white disabled:text-gray-700/40 dark:disabled:text-gray-500 dark:disabled:bg-gray-800 dark:disabled:border-gray-800",
- "ghost" =>
- "text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 disabled:text-gray-500 disabled:dark:text-gray-600"
+ @trigger_icon_class "btn-icon"
+
+ @trigger_themes %{
+ "primary" => "btn-theme-primary",
+ "secondary" => "btn-theme-secondary",
+ "ghost" => "btn-theme-ghost",
+ "link" => "btn-theme-link"
}
- @trigger_button_sizes %{
- "sm" => "px-3 py-2",
- "md" => "px-3.5 py-2.5"
+ @trigger_sizes %{
+ "xs" => "btn-xs",
+ "sm" => "btn-sm",
+ "md" => "btn-md"
}
defdelegate dropdown(assigns), to: Prima.Dropdown
@@ -26,6 +30,7 @@ defmodule PlausibleWeb.Components.PrimaDropdown do
attr(:id, :string, required: true)
attr(:theme, :string, default: "secondary")
attr(:size, :string, default: "md")
+ attr(:icon?, :boolean, default: false)
attr(:class, :string, default: "")
attr(:rest, :global)
slot(:inner_block, required: true)
@@ -34,9 +39,10 @@ defmodule PlausibleWeb.Components.PrimaDropdown do
assigns =
assign(assigns,
computed_class: [
- @trigger_button_base_class,
- @trigger_button_sizes[assigns.size],
- @trigger_button_themes[assigns.theme],
+ @trigger_base_class,
+ @trigger_sizes[assigns.size],
+ @trigger_themes[assigns.theme],
+ if(assigns.icon?, do: @trigger_icon_class, else: "justify-between"),
assigns.class
]
)
diff --git a/lib/plausible_web/components/team/notice.ex b/lib/plausible_web/components/team/notice.ex
index 5848159bda..8f552abb91 100644
--- a/lib/plausible_web/components/team/notice.ex
+++ b/lib/plausible_web/components/team/notice.ex
@@ -190,7 +190,7 @@ defmodule PlausibleWeb.Team.Notice do
theme="secondary"
size="sm"
>
- Accept <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ Accept <Heroicons.chevron_down mini class="size-4" />
</PrimaDropdown.dropdown_trigger>
<PrimaDropdown.dropdown_menu id={"ownership-accept-menu-#{@invitation.transfer_id}"}>
<PrimaDropdown.dropdown_item
diff --git a/lib/plausible_web/live/components/form.ex b/lib/plausible_web/live/components/form.ex
index 9f3278350a..dbb3c2630d 100644
--- a/lib/plausible_web/live/components/form.ex
+++ b/lib/plausible_web/live/components/form.ex
@@ -18,7 +18,10 @@ defmodule PlausibleWeb.Live.Components.Form do
<.input name="my-input" errors={["oh no!"]} />
"""
- @default_input_class "text-sm text-gray-900 dark:text-white dark:bg-gray-750 block pl-3.5 py-2.5 border-gray-300 dark:border-gray-800 transition-all duration-150 focus:outline-none focus:ring-3 focus:ring-indigo-500/20 dark:focus:ring-indigo-500/25 focus:border-indigo-500 rounded-md selection:bg-gray-200 dark:selection:bg-gray-700 disabled:bg-gray-100 disabled:dark:bg-gray-800 disabled:border-gray-200 disabled:dark:border-gray-800 disabled:text-gray-900/40 disabled:dark:text-white/30 disabled:cursor-not-allowed [&[readonly]]:bg-gray-100 [&[readonly]]:border-transparent [&[readonly]]:dark:border-transparent [&[readonly]]:dark:bg-gray-750 [&[readonly]]:focus:ring-0 [&[readonly]]:focus:border-transparent [&[readonly]]:dark:focus:border-transparent [&[readonly]]:cursor-default"
+ # Base and sizes are defined as component classes in assets/css/app.css,
+ # sharing the size scale with the `button` component. Update there only.
+ @input_class "input-base input-md"
+ @multiline_input_class "input-base input-md input-multiline"
attr(:id, :any, default: nil)
attr(:name, :any)
@@ -49,7 +52,7 @@ defmodule PlausibleWeb.Live.Components.Form do
multiple pattern placeholder readonly required rows size step x-bind:type x-model)
)
- attr(:class, :any, default: @default_input_class)
+ attr(:class, :any, default: "")
attr(:mt?, :boolean, default: true)
attr(:max_one_error, :boolean, default: false)
@@ -76,6 +79,9 @@ defmodule PlausibleWeb.Live.Components.Form do
end
def input(%{type: "select"} = assigns) do
+ base = if assigns.multiple, do: @multiline_input_class, else: @input_class
+ assigns = assign(assigns, :class, [base, assigns.class])
+
~H"""
<div class={@mt? && "mt-6"}>
<.label :if={@label != nil and @label != ""} for={@id} class="mb-1.5">
@@ -156,6 +162,8 @@ defmodule PlausibleWeb.Live.Components.Form do
end
def input(%{type: "textarea"} = assigns) do
+ assigns = assign(assigns, :class, [@multiline_input_class, assigns.class])
+
~H"""
<div class={@mt? && "mt-6"}>
<.label :if={@label != nil and @label != ""} class="mb-1.5" for={@id}>{@label}</.label>
@@ -180,7 +188,10 @@ defmodule PlausibleWeb.Live.Components.Form do
assigns.errors
end
- assigns = assign(assigns, :errors, errors)
+ assigns =
+ assigns
+ |> assign(:errors, errors)
+ |> assign(:class, [@input_class, assigns.class])
~H"""
<div class={@mt? && "mt-6"}>
@@ -219,8 +230,7 @@ defmodule PlausibleWeb.Live.Components.Form do
attr(:value, :string, default: "")
def input_with_clipboard(assigns) do
- class = [@default_input_class, "pr-20 w-full"]
- assigns = assign(assigns, class: class)
+ assigns = assign(assigns, class: "pr-20")
~H"""
<div>
@@ -273,7 +283,7 @@ defmodule PlausibleWeb.Live.Components.Form do
slot(:inner_block)
def password_field(assigns) do
- assigns = assign(assigns, :class, [@default_input_class, "pr-10"])
+ assigns = assign(assigns, :class, "pr-10")
~H"""
<div x-data="{ showPassword: false }">
@@ -325,7 +335,7 @@ defmodule PlausibleWeb.Live.Components.Form do
" this.form.querySelector('button[type=submit]').focus()"
input_class = [
- @default_input_class,
+ @input_class,
"font-mono tracking-[0.5em] font-medium text-center w-full"
]
@@ -565,7 +575,7 @@ defmodule PlausibleWeb.Live.Components.Form do
type="select"
options={@options}
onchange={"if (event.target.value) { location.href = '#{@href_base}' + event.target.value }"}
- class="dark:bg-gray-800 mt-1 block w-full pl-3.5 pr-10 py-2.5 text-base border-gray-300 dark:border-gray-500 outline-hidden focus:outline-hidden focus:ring-indigo-500 focus:border-indigo-500 rounded-md dark:text-gray-100"
+ mt?={false}
/>
</.form>
"""
diff --git a/lib/plausible_web/live/components/team.ex b/lib/plausible_web/live/components/team.ex
index 3a2215c898..459dd76a86 100644
--- a/lib/plausible_web/live/components/team.ex
+++ b/lib/plausible_web/live/components/team.ex
@@ -61,15 +61,15 @@ defmodule PlausibleWeb.Live.Components.Team do
</div>
<div class="flex-1 text-right">
<.dropdown id={"role-dropdown-#{@user.email}"}>
- <:button class="role bg-transparent text-gray-900 dark:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700 focus-visible:outline-gray-100 whitespace-nowrap truncate inline-flex items-center gap-x-2 font-medium rounded-md px-3.5 py-2.5 text-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:bg-gray-400 dark:disabled:text-white dark:disabled:text-gray-400 dark:disabled:bg-gray-700">
+ <:button theme="ghost" size="sm" class="role">
<span :if={@disabled} class="text-gray-400">
{@role |> to_string() |> String.capitalize()}
</span>
<span :if={not @disabled}>
{@role |> to_string() |> String.capitalize()}
</span>
- <Heroicons.chevron_down :if={@disabled} mini class="text-gray-400 size-4 mt-0.5" />
- <Heroicons.chevron_down :if={not @disabled} mini class="size-4 mt-0.5" />
+ <Heroicons.chevron_down :if={@disabled} mini class="text-gray-400 size-4" />
+ <Heroicons.chevron_down :if={not @disabled} mini class="size-4" />
</:button>
<:menu class="dropdown-items max-w-60">
<.role_item
@@ -124,9 +124,9 @@ defmodule PlausibleWeb.Live.Components.Team do
def role_picker(assigns) do
~H"""
<.dropdown id={@id}>
- <:button class="role w-[100px] inline-flex items-center justify-between font-medium rounded-md px-3 py-2 text-sm border border-gray-300 dark:border-gray-750 rounded-md text-gray-800 dark:text-gray-100 dark:bg-gray-750 dark:hover:bg-gray-700 focus-visible:outline-gray-100 whitespace-nowrap truncate shadow-xs hover:shadow-sm transition-all duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:bg-gray-400 dark:disabled:text-white dark:disabled:text-gray-400 dark:disabled:bg-gray-700">
+ <:button theme="secondary" size="md" class="role w-[100px] justify-between">
{@role |> Atom.to_string() |> String.capitalize()}
- <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ <Heroicons.chevron_down mini class="size-4" />
</:button>
<:menu class="dropdown-items max-w-60">
<.role_item
diff --git a/lib/plausible_web/live/goal_settings/list.ex b/lib/plausible_web/live/goal_settings/list.ex
index af4e94fd28..35beb6a708 100644
--- a/lib/plausible_web/live/goal_settings/list.ex
+++ b/lib/plausible_web/live/goal_settings/list.ex
@@ -25,7 +25,7 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
<.filter_bar filter_text={@filter_text} placeholder="Search Goals">
<PrimaDropdown.dropdown id="add-goal-dropdown">
<PrimaDropdown.dropdown_trigger id="add-goal-dropdown-trigger" theme="primary">
- Add goal <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ Add goal <Heroicons.chevron_down mini class="size-4" />
</PrimaDropdown.dropdown_trigger>
<PrimaDropdown.dropdown_menu id="add-goal-dropdown-menu">
@@ -115,7 +115,6 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
data-test-id="edit-goal-button"
phx-click="edit-goal"
phx-value-goal-id={goal.id}
- class="mt-1"
id={"edit-goal-#{goal.id}"}
/>
<.edit_button
@@ -123,7 +122,6 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
id={"edit-goal-#{goal.id}-disabled"}
data-test-id="edit-goal-button"
disabled
- class="cursor-not-allowed mt-1"
/>
<.delete_button
id={"delete-goal-#{goal.id}"}
@@ -131,7 +129,6 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
phx-value-goal-id={goal.id}
phx-value-goal-name={goal.event_name}
data-confirm={delete_confirmation_text(goal)}
- class="mt-1"
/>
</.td>
</:tbody>
@@ -172,7 +169,7 @@ defmodule PlausibleWeb.Live.GoalSettings.List do
id="add-goal-dropdown-empty-trigger"
theme="primary"
>
- Add goal <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ Add goal <Heroicons.chevron_down mini class="size-4" />
</PrimaDropdown.dropdown_trigger>
<PrimaDropdown.dropdown_menu id="add-goal-dropdown-empty-menu">
diff --git a/lib/plausible_web/live/shared_link_settings.ex b/lib/plausible_web/live/shared_link_settings.ex
index dabe7478b6..d627cf27f9 100644
--- a/lib/plausible_web/live/shared_link_settings.ex
+++ b/lib/plausible_web/live/shared_link_settings.ex
@@ -159,12 +159,10 @@ defmodule PlausibleWeb.Live.SharedLinkSettings do
</.td>
<.td actions>
<.edit_button
- class="mt-1"
phx-click="edit-shared-link"
phx-value-slug={link.slug}
/>
<.delete_button
- class="mt-1"
phx-click="delete-shared-link"
phx-value-slug={link.slug}
data-confirm="Are you sure you want to delete this shared link? The stats will not be accessible with this link anymore."
diff --git a/lib/plausible_web/live/sites.ex b/lib/plausible_web/live/sites.ex
index fee9e193c2..93162af762 100644
--- a/lib/plausible_web/live/sites.ex
+++ b/lib/plausible_web/live/sites.ex
@@ -142,8 +142,7 @@ defmodule PlausibleWeb.Live.Sites do
id="add-site-dropdown"
>
<PrimaDropdown.dropdown_trigger id="add-site-dropdown-trigger" theme="primary">
- <Heroicons.plus class="size-4" /> Add
- <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ <Heroicons.plus class="size-4" /> Add <Heroicons.chevron_down mini class="size-4" />
</PrimaDropdown.dropdown_trigger>
<PrimaDropdown.dropdown_menu id="add-site-dropdown-menu">
@@ -218,7 +217,7 @@ defmodule PlausibleWeb.Live.Sites do
id="go-to-team-dropdown"
>
<PrimaDropdown.dropdown_trigger id="go-to-team-dropdown-trigger" theme="secondary">
- Go to team sites <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ Go to team sites <Heroicons.chevron_down mini class="size-4" />
</PrimaDropdown.dropdown_trigger>
<PrimaDropdown.dropdown_menu id="go-to-team-dropdown-menu">
@@ -625,8 +624,9 @@ defmodule PlausibleWeb.Live.Sites do
<PrimaDropdown.dropdown id={@dropdown_id}>
<PrimaDropdown.dropdown_trigger
id={"#{@dropdown_id}-trigger"}
- theme="ghost"
- class="!px-2.5"
+ theme="link"
+ size="sm"
+ icon?={true}
>
<Heroicons.ellipsis_vertical class="size-5" />
</PrimaDropdown.dropdown_trigger>
@@ -788,7 +788,7 @@ defmodule PlausibleWeb.Live.Sites do
class="min-w-40 group-has-[[data-sort-trigger].phx-click-loading]/sort:text-gray-800/50 group-has-[[data-sort-trigger].phx-click-loading]/sort:hover:text-gray-800/50 group-has-[[data-sort-trigger].phx-click-loading]/sort:dark:text-gray-100/50 group-has-[[data-sort-trigger].phx-click-loading]/sort:dark:hover:text-gray-100/50 group-has-[[data-sort-trigger].phx-click-loading]/sort:pointer-events-none"
>
{@current_sort_label}
- <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ <Heroicons.chevron_down mini class="size-4" />
</PrimaDropdown.dropdown_trigger>
<PrimaDropdown.dropdown_menu id="sort-dropdown-menu">
<%= for {label, %Index.UserPreference{sort_by: sort_by, sort_direction: direction}} <- @sort_options do %>
diff --git a/lib/plausible_web/live/team_setup.ex b/lib/plausible_web/live/team_setup.ex
index 47068dd575..16860ced9d 100644
--- a/lib/plausible_web/live/team_setup.ex
+++ b/lib/plausible_web/live/team_setup.ex
@@ -132,7 +132,7 @@ defmodule PlausibleWeb.Live.TeamSetup do
class="role w-[100px] list-none [&::-webkit-details-marker]:hidden cursor-pointer inline-flex items-center justify-between font-medium rounded-md px-3 py-2 text-sm border border-gray-300 dark:border-gray-750 text-gray-800 dark:text-gray-100 dark:bg-gray-750 dark:hover:bg-gray-700 whitespace-nowrap truncate shadow-xs hover:shadow-sm transition-all duration-150"
>
<span data-role-label>{@row.role |> Atom.to_string() |> String.capitalize()}</span>
- <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ <Heroicons.chevron_down mini class="size-4" />
</summary>
<div
diff --git a/lib/plausible_web/live/tracking_settings.ex b/lib/plausible_web/live/tracking_settings.ex
index c2dabffe8e..acb3bbacd1 100644
--- a/lib/plausible_web/live/tracking_settings.ex
+++ b/lib/plausible_web/live/tracking_settings.ex
@@ -187,8 +187,9 @@ defmodule PlausibleWeb.Live.TrackingSettings do
<.tooltip centered?={true} interactive?={false}>
<:tooltip_content>Learn more</:tooltip_content>
<.button_link
- theme="icon"
+ theme="link"
size="xs"
+ icon?={true}
mt?={false}
href={@href}
target="_blank"
diff --git a/lib/plausible_web/templates/site/settings_integrations.html.heex b/lib/plausible_web/templates/site/settings_integrations.html.heex
index b58ce971eb..dbd16aeb36 100644
--- a/lib/plausible_web/templates/site/settings_integrations.html.heex
+++ b/lib/plausible_web/templates/site/settings_integrations.html.heex
@@ -91,7 +91,7 @@
id="search-console-connect"
to={Plausible.Google.API.search_console_authorize_url(@site)}
/>
- <div class="mt-8 text-sm">
+ <div class="mt-4 sm:mt-6 text-sm">
NB: You also need to set up your site on
<.styled_link href="https://search.google.com/search-console/about" new_tab={true}>
Google Search Console
diff --git a/lib/plausible_web/templates/site/settings_people.html.heex b/lib/plausible_web/templates/site/settings_people.html.heex
index c745bcb3b4..c91d735310 100644
--- a/lib/plausible_web/templates/site/settings_people.html.heex
+++ b/lib/plausible_web/templates/site/settings_people.html.heex
@@ -36,7 +36,7 @@
<div class="shrink-0">
<img
src={Plausible.Auth.User.profile_img_url(membership.user)}
- class="h-8 w-8 rounded-full"
+ class="size-8 rounded-full"
/>
</div>
<div class="flex-1 min-w-0">
@@ -52,9 +52,9 @@
</div>
<.dropdown>
- <:button class="bg-transparent text-gray-800 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800 focus-visible:outline-gray-100 whitespace-nowrap truncate inline-flex items-center gap-x-2 font-medium rounded-md px-3.5 py-2.5 text-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:bg-gray-400 dark:disabled:text-white dark:disabled:text-gray-400 dark:disabled:bg-gray-700">
+ <:button theme="ghost" size="sm">
{site_role(membership)}
- <Heroicons.chevron_down mini class="size-4 mt-0.5" />
+ <Heroicons.chevron_down mini class="size-4" />
</:button>
<:menu class="max-w-60">
<%= if membership.role == :owner do %>