Skip to content

Commit

Permalink
Fix style and warning
Browse files Browse the repository at this point in the history
  • Loading branch information
bluzky committed Nov 9, 2024
1 parent aa0b03d commit befb9e7
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/salad_ui/alert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ defmodule SaladUI.Alert do
@variants %{
variant: %{
"default" => "bg-background text-foreground",
"destructive" => "border-destructive/50 text-destructive dark:border-destructive [&>span]:text-destructive"
"destructive" => "bg-background border-destructive/50 text-destructive dark:border-destructive [&>span]:text-destructive"
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/salad_ui/avatar.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defmodule SaladUI.Avatar do

attr :class, :string, default: nil
attr :rest, :global
slot :inner_block, required: false

def avatar(assigns) do
~H"""
Expand All @@ -17,7 +18,7 @@ defmodule SaladUI.Avatar do
end

attr :class, :string, default: nil
attr :rest, :global
attr :rest, :global, include: ~w(alt src)

def avatar_image(assigns) do
~H"""
Expand Down
2 changes: 1 addition & 1 deletion lib/salad_ui/button.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule SaladUI.Button do
<.button phx-click="go" class="ml-2">Send!</.button>
"""
attr :type, :string, default: nil
attr :class, :string, default: nil
attr :class, :any, default: nil

attr :variant, :string,
values: ~w(default secondary destructive outline ghost link),
Expand Down
4 changes: 2 additions & 2 deletions lib/salad_ui/dialog.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ defmodule SaladUI.Dialog do
def show_modal(js \\ %JS{}, id) when is_binary(id) do
js
|> JS.set_attribute({"data-state", "open"}, to: "##{id}")
|> JS.show(to: "##{id}", transition: {"_", "_", "_"}, time: 150)
|> JS.show(to: "##{id}", transition: {"_", "_", "_"}, time: 130)
|> JS.add_class("overflow-hidden", to: "body")
|> JS.focus_first(to: "##{id}-content")
end

def hide_modal(js \\ %JS{}, id) do
js
|> JS.set_attribute({"data-state", "closed"}, to: "##{id}")
|> JS.hide(to: "##{id}", transition: {"_", "_", "_"}, time: 150)
|> JS.hide(to: "##{id}", transition: {"_", "_", "_"}, time: 130)
|> JS.remove_class("overflow-hidden", to: "body")
|> JS.pop_focus()
end
Expand Down
2 changes: 1 addition & 1 deletion lib/salad_ui/input.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule SaladUI.Input do

attr :field, Phoenix.HTML.FormField, doc: "a form field struct retrieved from the form, for example: @form[:email]"

attr :class, :string, default: nil
attr :class, :any, default: nil
attr :rest, :global, include: ~w(accept autocomplete capture cols disabled form list max maxlength min minlength
multiple pattern placeholder readonly required rows size step)

Expand Down
4 changes: 2 additions & 2 deletions lib/salad_ui/slider.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ defmodule SaladUI.Slider do

assigns =
assigns
|> Map.put(:value, normalize_integer(assigns[:value]))
|> Map.put(:min, normalize_integer(assigns[:min]))
|> Map.put(:value, normalize_integer(assigns[:value] || 0))
|> Map.put(:min, normalize_integer(assigns[:min] || 0))
|> Map.put(:max, normalize_integer(assigns[:max]))
|> Map.put(:step, normalize_integer(assigns[:step]))

Expand Down
2 changes: 1 addition & 1 deletion lib/salad_ui/textarea.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule SaladUI.Textarea do
attr :id, :any, default: nil
attr :name, :string, default: nil
attr :value, :string
attr :class, :string, default: nil
attr :class, :any, default: nil
attr :rest, :global

def textarea(assigns) do
Expand Down

0 comments on commit befb9e7

Please sign in to comment.