-
-
Notifications
You must be signed in to change notification settings - Fork 934
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
33c2eb5
commit 980cf5e
Showing
2 changed files
with
72 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class AlertComponentPreview < Lookbook::Preview | ||
layout "hammy_component_preview" | ||
|
||
# @param content text "content" | ||
# @param style select "style", { choices: [notice, alert, error, success, primary, neutral] } | ||
# @param closeable toggle "closeable" | ||
def default(content = "Example content", style: :notice, closeable: false) | ||
render AlertComponent.new(style:, closeable:) do | ||
content | ||
end | ||
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,60 @@ | ||
class ButtonComponentPreview < Lookbook::Preview | ||
layout "hammy_component_preview" | ||
|
||
# @param text text "text" | ||
# @param url url "link" | ||
# @param type select "type", { choices: [button, link, submit] } | ||
# @param color select "color", { choices: [primary, secondary, red, orange, hammy, yellow, green, blue, neutral] } | ||
# @param size select "size", { choices: [small, large] } | ||
# @param style select "style", { choices: [fill, outline, plain] } | ||
# @param disabled toggle "disabled" | ||
def default(text: "Button", url: "", type: :button, color: :primary, size: :large, style: :fill, disabled: false) # rubocop:disable Metrics/ParameterLists | ||
args = [text, url].compact_blank | ||
render ButtonComponent.new( | ||
*args, | ||
type: type, | ||
color: color, | ||
size: size, | ||
style: style, | ||
disabled: disabled | ||
) | ||
end | ||
|
||
# @param text text "text" | ||
# @param url url "link" | ||
# @param type select "type", { choices: [button, link, submit] } | ||
# @param color select "color", { choices: [primary, secondary, red, orange, hammy, yellow, green, blue, neutral] } | ||
# @param size select "size", { choices: [small, large] } | ||
# @param style select "style", { choices: [fill, outline, plain] } | ||
# @param disabled toggle "disabled" | ||
def outline(text: "Button", url: "", type: :button, color: :primary, size: :large, style: :outline, disabled: false) # rubocop:disable Metrics/ParameterLists | ||
args = [text, url].compact_blank | ||
render ButtonComponent.new( | ||
*args, | ||
type: type, | ||
color: color, | ||
size: size, | ||
style: style, | ||
disabled: disabled | ||
) | ||
end | ||
|
||
# @param text text "text" | ||
# @param url url "link" | ||
# @param type select "type", { choices: [button, link, submit] } | ||
# @param color select "color", { choices: [primary, secondary, red, orange, hammy, yellow, green, blue, neutral] } | ||
# @param size select "size", { choices: [small, large] } | ||
# @param style select "style", { choices: [fill, outline, plain] } | ||
# @param disabled toggle "disabled" | ||
def plain(text: "Button", url: "", type: :button, color: :primary, size: :large, style: :plain, disabled: false) # rubocop:disable Metrics/ParameterLists | ||
args = [text, url].compact_blank | ||
render ButtonComponent.new( | ||
*args, | ||
type: type, | ||
color: color, | ||
size: size, | ||
style: style, | ||
disabled: disabled | ||
) | ||
end | ||
end |