defmodule Doggo do
@moduledoc """
Collection of Phoenix Components.
"""
use Phoenix.Component
alias Phoenix.HTML.Form
alias Phoenix.LiveView.JS
## Components
@doc """
The action bar offers users quick access to primary actions within the
application.
It is typically positioned to float above other content.
## Example
<.action_bar>
<:item label="Edit" on_click={JS.push("edit")}>
<.icon size={:small}>
<:item label="Move" on_click={JS.push("move")}>
<.icon size={:small}>
<:item label="Archive" on_click={JS.push("archive")}>
<.icon size={:small}>
"""
@doc type: :component
attr :class, :any,
default: [],
doc: "Additional CSS classes. Can be a string or a list of strings."
attr :rest, :global, doc: "Any additional HTML attributes."
slot :item, required: true do
attr :label, :string, required: true
attr :on_click, JS, required: true
end
def action_bar(assigns) do
~H"""
"""
end
@doc """
The app bar is typically located at the top of the interface and provides
access to key features and navigation options.
## Usage
<.app_bar title="Page title">
<:navigation label="Open menu" on_click={JS.push("toggle-menu")}>
<.icon>
<:action label="Search" on_click={JS.push("search")}>
<.icon>
<:action label="Like" on_click={JS.push("like")}>
<.icon>
"""
@doc type: :component
attr :title, :string,
default: nil,
doc: "The page title. Will be set as `h1`."
attr :class, :any,
default: [],
doc: "Additional CSS classes. Can be a string or a list of strings."
attr :rest, :global, doc: "Any additional HTML attributes."
slot :navigation,
doc: """
Slot for a single button left of the title, typically used for a menu button
that toggles a drawer, or for a back link.
""" do
attr :label, :string, required: true
attr :on_click, :any,
required: true,
doc: "Event name or `Phoenix.LiveView.JS` command."
end
slot :action, doc: "Slot for action buttons right of the title." do
attr :label, :string, required: true
attr :on_click, :any,
required: true,
doc: "Event name or `Phoenix.LiveView.JS` command."
end
def app_bar(assigns) do
~H"""