This commit is contained in:
Chris McCord 2022-05-16 10:23:42 -04:00
parent 433a2f7faf
commit e3fefd74b5
3 changed files with 12 additions and 3 deletions

View file

@ -63,6 +63,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :flash, :map
attr :kiny, :atom
def flash(%{kind: :error} = assigns) do
~H"""
<%= if live_flash(@flash, @kind) do %>
@ -144,6 +145,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :name, :atom, required: true
attr :outlined, :boolean, default: false
attr :rest, :global, default: %{class: "w-4 h-4 inline-block"}
def icon(assigns) do
assigns = assign_new(assigns, :"aria-hidden", fn -> !Map.has_key?(assigns, :"aria-label") end)
@ -219,6 +221,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :title, :list, default: []
attr :subtitle, :list, default: []
attr :link, :list, default: []
def dropdown(assigns) do
~H"""
<!-- User account dropdown -->
@ -402,6 +405,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :confirm, :list, default: []
attr :cancel, :list, default: []
attr :rest, :global
def modal(assigns) do
~H"""
<div
@ -485,6 +489,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :id, :string, required: true
attr :content, :string
def focus_wrap(assigns) do
~H"""
<div id={@id} phx-hook="FocusWrap" data-content={@content}>
@ -499,6 +504,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :min, :integer, default: 0
attr :max, :integer, default: 100
attr :value, :integer
def progress_bar(assigns) do
assigns = assign_new(assigns, :value, fn -> assigns[:min] || 0 end)
@ -521,6 +527,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
end
attr :actions, :list, default: []
def title_bar(assigns) do
~H"""
<!-- Page title & actions -->
@ -542,6 +549,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :patch, :string
attr :primary, :boolean, default: false
attr :rest, :global
def button(%{patch: _} = assigns) do
~H"""
<%= if @primary do %>
@ -584,6 +592,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :rows, :list, required: true
# slots
attr :col, :list, required: true
def table(assigns) do
assigns =
assigns
@ -632,6 +641,7 @@ defmodule LiveBeatsWeb.LiveHelpers do
attr :active_id, :any, default: nil
# slots
attr :col, :list
def live_table(assigns) do
assigns = assign(assigns, :col, for(col <- assigns.col, col[:if] != false, do: col))

View file

@ -40,8 +40,7 @@ defmodule LiveBeats.MixProject do
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
# {:phoenix_live_view, github: "phoenixframework/phoenix_live_view", override: true},
{:phoenix_live_view, path: "~/oss/phoenix_live_view", override: true},
{:phoenix_live_view, github: "phoenixframework/phoenix_live_view", override: true},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.6"},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},

View file

@ -27,7 +27,7 @@
"phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
"phoenix_live_dashboard": {:hex, :phoenix_live_dashboard, "0.6.2", "0769470265eb13af01b5001b29cb935f4710d6adaa1ffc18417a570a337a2f0f", [:mix], [{:ecto, "~> 3.6.2 or ~> 3.7", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_mysql_extras, "~> 0.3", [hex: :ecto_mysql_extras, repo: "hexpm", optional: true]}, {:ecto_psql_extras, "~> 0.7", [hex: :ecto_psql_extras, repo: "hexpm", optional: true]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.17.1", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "5bc6c6b38a2ca8b5020b442322fcee6afd5e641637a0b1fb059d4bd89bc58e7b"},
"phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"},
"phoenix_live_view": {:git, "https://github.com/phoenixframework/phoenix_live_view.git", "e24527536890be2f0565c4a6d122a89e819df58e", []},
"phoenix_live_view": {:git, "https://github.com/phoenixframework/phoenix_live_view.git", "8bae1b3944c2cd9c3078839a980eca56cc59d449", []},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.1", "ba04e489ef03763bf28a17eb2eaddc2c20c6d217e2150a61e3298b0f4c2012b5", [:mix], [], "hexpm", "81367c6d1eea5878ad726be80808eb5a787a23dee699f96e72b1109c57cdd8d9"},
"phoenix_view": {:hex, :phoenix_view, "1.0.0", "fea71ecaaed71178b26dd65c401607de5ec22e2e9ef141389c721b3f3d4d8011", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "82be3e2516f5633220246e2e58181282c71640dab7afc04f70ad94253025db0c"},
"plug": {:hex, :plug, "1.13.4", "addb6e125347226e3b11489e23d22a60f7ab74786befb86c14f94fb5f23ca9a4", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "06114c1f2a334212fe3ae567dbb3b1d29fd492c1a09783d52f3d489c1a6f4cf2"},