defmodule SigmaKit.Components.Buttons do use Phoenix.LiveComponent import SigmaKit.Components.Icons @doc """ Renders a simple button component. ## Attributes * `:class` - Additional CSS classes to apply to the button. Defaults to `nil`. * `:primary` - A boolean indicating if the button should use the primary style. Defaults to `false`. * `:light` - A boolean indicating if the button should use the light style. Defaults to `false`. * `:danger` - A boolean indicating if the button should use the danger style. Defaults to `false`. * `:inline` - A boolean indicating if the button should use the inline style. Defaults to `false`. * `:rest` - A map of additional global attributes (e.g., `disabled`, `form`, `name`, `value`, `type`) to apply to the button. ## Slots * `:inner_block` (required) - The content to render inside the button. ## Styles The button supports multiple styles based on the attributes provided: * `:primary`: A blue button with a hover effect. * `:light`: A light gray button with a hover effect. * `:danger`: A red button for destructive actions. * `:inline`: A white button with a border and hover effects, suitable for inline usage. """ attr :class, :any, default: nil attr :primary, :boolean, default: false attr :light, :boolean, default: false attr :danger, :boolean, default: false attr :inline, :boolean, default: false attr :rest, :global, include: ~w(type disabled form name value) slot :inner_block, required: true def button(assigns) do ~H""" """ end @doc """ Renders a toggle switch with icons on the left and right sides. ## Attributes - `:left_icon` (string, required): The name of the icon to display on the left side of the toggle switch. - `:right_icon` (string, required): The name of the icon to display on the right side of the toggle switch. - `:event` (string, required): The event name triggered when the toggle switch is clicked. - `:target` (optional): The target for the `phx-click` event. - `:left` (boolean, required): Determines if the toggle is in the "left" position. - `:right` (boolean, required): Determines if the toggle is in the "right" position. """ attr :left_icon, :string, required: true attr :right_icon, :string, required: true attr :event, :string, required: true attr :target, :any, default: nil attr :left, :boolean, required: true attr :right, :boolean, required: true def icon_toggle_switch(assigns) do ~H"""