defmodule PinchflatWeb.CustomComponents.ButtonComponents do @moduledoc false use Phoenix.Component, global_prefixes: ~w(x-) alias PinchflatWeb.CoreComponents alias PinchflatWeb.CustomComponents.TextComponents @doc """ Render a button ## Examples <.button color="bg-primary" rounding="rounded-sm"> Click me """ attr :color, :string, default: "bg-primary" attr :rounding, :string, default: "rounded-sm" attr :class, :string, default: "" attr :type, :string, default: "submit" attr :disabled, :boolean, default: false attr :rest, :global slot :inner_block, required: true def button(assigns) do ~H""" """ end @doc """ Render a dropdown based off a button ## Examples <.button_dropdown text="Actions"> <:option>TEST """ attr :text, :string, required: true attr :class, :string, default: "" slot :option, required: true def button_dropdown(assigns) do ~H"""
{@text}
""" end @doc """ Render a button with an icon. Optionally include a tooltip. ## Examples <.icon_button icon_name="hero-check" tooltip="Complete" /> """ attr :icon_name, :string, required: true attr :class, :string, default: "" attr :tooltip, :string, default: nil attr :rest, :global def icon_button(assigns) do ~H""" """ end end