defmodule RaxolWeb.CoreComponents do @moduledoc """ Provides core UI components for the Raxol web interface. """ use Phoenix.Component @doc """ Renders a button with the given text and options. """ attr :type, :string, default: "button" attr :class, :string, default: nil attr :disabled, :boolean, default: false attr :rest, :global, include: ~w(form name value) slot(:inner_block, required: true) def button(assigns) do ~H""" """ end @doc """ Renders a form input with the given type and options. """ attr :type, :string, default: "text" attr :name, :string, required: true attr(:value, :any) attr :placeholder, :string, default: nil attr :class, :string, default: nil attr :disabled, :boolean, default: false attr :min, :string, default: nil attr :max, :string, default: nil attr :step, :string, default: nil attr :rest, :global, include: ~w(autocomplete form required) def input(assigns) do ~H""" """ end @doc """ Renders a label for a form input. """ attr :for, :string, required: true attr :class, :string, default: nil slot(:inner_block, required: true) def label(assigns) do ~H""" """ end @doc """ Renders a form group with a label and input. """ attr :name, :string, required: true attr :label, :string, required: true attr :type, :string, default: "text" attr(:value, :any) attr :placeholder, :string, default: nil attr :class, :string, default: nil attr :disabled, :boolean, default: false attr :min, :string, default: nil attr :max, :string, default: nil attr :step, :string, default: nil attr :rest, :global, include: ~w(autocomplete form required) def form_group(assigns) do ~H"""
<.label for={@name}><%= @label %> <.input type={@type} name={@name} value={@value} placeholder={@placeholder} disabled={@disabled} min={@min} max={@max} step={@step} {@rest} />
""" end @doc """ Renders a flash message. """ attr :kind, :string, required: true attr :title, :string, default: nil attr :rest, :global, include: ~w(phx-click phx-value) slot(:inner_block, required: true) def flash(assigns) do ~H""" """ end end