-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add size variants for menu item [MDS-836] (#791)
- Loading branch information
1 parent
f3a980d
commit b42bf70
Showing
26 changed files
with
239 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
defmodule Moon.Lego.ChevronUpDown do | ||
@moduledoc false | ||
|
||
use Moon.StatelessComponent | ||
|
||
alias Moon.Icon | ||
|
||
prop(is_selected, :boolean, from_context: :is_selected) | ||
prop(class, :css_class) | ||
|
||
def render(assigns) do | ||
~F""" | ||
<Icon | ||
name="controls_chevron_down" | ||
class={merge([ | ||
[ | ||
"transition-transform transition-200", | ||
"rotate-180": @is_selected | ||
], | ||
@class | ||
])} | ||
/> | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
defmodule Moon.Lego.MultiTitle do | ||
@moduledoc false | ||
|
||
use Moon.StatelessComponent | ||
|
||
@doc "Additional Tailwind classes" | ||
prop(class, :css_class) | ||
@doc "Additional Tailwind classes for title" | ||
prop(title_class, :css_class) | ||
@doc "Additional Tailwind classes for text" | ||
prop(text_class, :css_class) | ||
@doc "Data-testid attribute for DOM element" | ||
prop(testid, :string) | ||
@doc "Id attribute for the DOM element" | ||
prop(id, :string) | ||
@doc "Title of the menu item" | ||
prop(title, :string) | ||
@doc "Text of the menu item" | ||
prop(text, :string) | ||
@doc "Default slot" | ||
slot(default) | ||
|
||
def render(assigns) do | ||
~F""" | ||
<span | ||
{=@id} | ||
data-testid={@testid} | ||
class={merge(["block grow text-start text-bulma overflow-hidden", @class])} | ||
> | ||
<span :if={@title} class={merge(["block text-bulma text-moon-14", @title_class])}>{@title}</span> | ||
<span | ||
:if={@text || slot_assigned?(:default)} | ||
class={merge(["flex text-trunks text-moon-12", @text_class])} | ||
> | ||
<span class="flex-1 truncate"><#slot>{@text}</#slot></span> | ||
</span> | ||
</span> | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.