Current section
41 Versions
Jump to
Current section
41 Versions
Compare versions
4
files changed
+31
additions
-5
deletions
| @@ -165,7 +165,7 @@ List of available components. | |
| 165 165 | | [Countdown](https://daisyui.com/components/countdown) | ❌ | ❌ | |
| 166 166 | | [Diff](https://daisyui.com/components/diff/) | ❌ | ❌ | |
| 167 167 | | [Kbd](https://daisyui.com/components/kbd) | ❌ | ❌ | |
| 168 | - | [Stat](https://daisyui.com/components/stat) | ✅ | ❌ | |
| 168 | + | [Stat](https://daisyui.com/components/stat) | ✅ | ✅ | |
| 169 169 | | [Table](https://daisyui.com/components/table) | ✅ | ✅ | |
| 170 170 | | [Timeline](https://daisyui.com/components/timeline/) | ❌ | ❌ | |
| 171 171 | |
| @@ -192,7 +192,7 @@ List of available components. | |
| 192 192 | | [Radial progress](https://daisyui.com/components/radial-progress) | ❌ | ❌ | |
| 193 193 | | [Skeleton](https://daisyui.com/components/skeleton/) | ❌ | ❌ | |
| 194 194 | | [Toast](https://daisyui.com/components/toast) | ❌ | ❌ | |
| 195 | - | [Tooltip](https://daisyui.com/components/tooltip) | ✅ | ❌ | |
| 195 | + | [Tooltip](https://daisyui.com/components/tooltip) | ✅ | ✅ | |
| 196 196 | |
| 197 197 | ### Data Input |
| @@ -1,7 +1,7 @@ | |
| 1 1 | {<<"links">>, |
| 2 2 | [{<<"GitHub">>,<<"https://github.com/phcurado/daisy_ui_components">>}]}. |
| 3 3 | {<<"name">>,<<"daisy_ui_components">>}. |
| 4 | - {<<"version">>,<<"0.7.3">>}. |
| 4 | + {<<"version">>,<<"0.7.4">>}. |
| 5 5 | {<<"description">>,<<"DaisyUI component library for LiveView">>}. |
| 6 6 | {<<"elixir">>,<<"~> 1.14">>}. |
| 7 7 | {<<"app">>,<<"daisy_ui_components">>}. |
| @@ -9,6 +9,26 @@ defmodule DaisyUIComponents.Swap do | |
| 9 9 | |
| 10 10 | import DaisyUIComponents.Icon |
| 11 11 | |
| 12 | + @doc ~S""" |
| 13 | + Render a Swap component |
| 14 | + |
| 15 | + ## Examples |
| 16 | + |
| 17 | + <.swap > |
| 18 | + <:swap_on name="ON" /> |
| 19 | + <:swap_off name="OFF" /> |
| 20 | + </.swap> |
| 21 | + |
| 22 | + with theme controller |
| 23 | + |
| 24 | + <.swap > |
| 25 | + <:controller> |
| 26 | + <input type="checkbox" class="theme-controller" value="synthwave" /> |
| 27 | + </:controller> |
| 28 | + <:swap_on name="ON" /> |
| 29 | + <:swap_off name="OFF" /> |
| 30 | + </.swap> |
| 31 | + """ |
| 12 32 | attr :class, :any, default: nil |
| 13 33 | attr :animation, :string, values: ["flip", "rotate"] |
| 14 34 | attr :rest, :global |
| @@ -27,6 +47,8 @@ defmodule DaisyUIComponents.Swap do | |
| 27 47 | attr :name, :string, required: true |
| 28 48 | end |
| 29 49 | |
| 50 | + slot :controller, doc: "The swap input controller" |
| 51 | + |
| 30 52 | def swap(assigns) do |
| 31 53 | assigns = |
| 32 54 | assigns |
| @@ -34,7 +56,11 @@ defmodule DaisyUIComponents.Swap do | |
| 34 56 | |
| 35 57 | ~H""" |
| 36 58 | <label class={@class} {@rest}> |
| 37 | - <input type="checkbox" /> |
| 59 | + <%= if render?(@controller) do %> |
| 60 | + {render_slot(@controller)} |
| 61 | + <% else %> |
| 62 | + <input type="checkbox" /> |
| 63 | + <% end %> |
| 38 64 | <.swap_mode |
| 39 65 | :for={swap_on <- @swap_on} |
| 40 66 | type={Map.get(swap_on, :type, "label")} |
| @@ -2,7 +2,7 @@ defmodule DaisyUIComponents.MixProject do | |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 4 | @source_url "https://github.com/phcurado/daisy_ui_components" |
| 5 | - @version "0.7.3" |
| 5 | + @version "0.7.4" |
| 6 6 | |
| 7 7 | def project do |
| 8 8 | [ |