defmodule SigmaKit.Components.Popups do
use Phoenix.LiveComponent
attr :text, :string
slot :inner_block
def tooltip(assigns) do
assigns = assign(assigns, :id, SigmaKit.Util.random_string())
~H"""
{render_slot(@inner_block)}
"""
end
attr :placement, :string, default: "top"
attr :class, :any, default: nil
attr :plain, :boolean,
default: false,
doc: "If true, the popover will not have a shadow or border."
attr :nopad, :boolean,
default: false,
doc: "If true, the popover will not have internal padding"
attr :rest, :global, doc: "Any additional HTML attributes to add to the floating container."
attr :trigger_click,
:boolean,
default: false,
doc: "If true the popover will open on click, instead of on hover"
attr :minwidth, :boolean,
default: false,
doc: "If true the popover will have a min-width equal to the trigger element"
slot :trigger
slot :inner_block
def popover(assigns) do
assigns = assign(assigns, :id, SigmaKit.Util.random_string())
~H"""
{render_slot(@trigger)}
{render_slot(@inner_block)}
"""
end
end