-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: 💄 Cleaned up styles using updated tailwind config
- Loading branch information
Showing
12 changed files
with
249 additions
and
80 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
88 changes: 85 additions & 3 deletions
88
embedded_gems/pathogen/previews/pathogen/button_preview.rb
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 |
---|---|---|
@@ -1,9 +1,91 @@ | ||
# frozen_string_literal: true | ||
|
||
module Pathogen | ||
# Preview class for Primer::Button component | ||
class ButtonPreview < ViewComponent::Preview | ||
# @label Default | ||
def default; end | ||
# @param scheme select { choices: [default,primary, danger] } "The color scheme of the button." | ||
# @param size select { choices: [small, medium] } "The size of the button." | ||
# @param disabled toggle "The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants." | ||
# @param block toggle "If true, the button will take up the full width of its container." | ||
def playground(scheme: :default, size: :medium, disabled: false, block: false) | ||
render Pathogen::Button.new(scheme:, size:, disabled:, block:, test_selector: 'playground') do | ||
'Button' | ||
end | ||
end | ||
|
||
# @param disabled toggle "The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants." | ||
def default(disabled: false) | ||
render Pathogen::Button.new(disabled:, test_selector: 'default') do | ||
'Button' | ||
end | ||
end | ||
|
||
# @param disabled toggle "The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants." | ||
# @param block toggle "If true, the button will take up the full width of its container." | ||
def primary(disabled: false, block: false) | ||
render Pathogen::Button.new(scheme: :primary, disabled:, block:, test_selector: 'primary') do | ||
'Button' | ||
end | ||
end | ||
|
||
# @param disabled toggle "The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants." | ||
# @param block toggle "If true, the button will take up the full width of its container." | ||
def danger(disabled: false, block: false) | ||
render Pathogen::Button.new(scheme: :danger, disabled:, block:, test_selector: 'danger') do | ||
'Button' | ||
end | ||
end | ||
|
||
def all_schemes; end | ||
|
||
def full_width | ||
render Pathogen::Button.new(block: true, test_selector: 'full-width') do | ||
'Button' | ||
end | ||
end | ||
|
||
# @param scheme select { choices: [default,primary, danger] } "The color scheme of the button." | ||
# @param href text "The URL to link to." | ||
# @param disabled toggle "The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants." | ||
def link_as_a_button(scheme: :default, href: '#', disabled: false) | ||
render Pathogen::Button.new(scheme:, href:, tag: :a, disabled:, test_selector: 'link-as-a-button') do | ||
'Button' | ||
end | ||
end | ||
|
||
# @param scheme select { choices: [default,primary, danger] } "The color scheme of the button." | ||
# @param size select { choices: [small, medium] } "The size of the button." | ||
def leading_visual(scheme: :primary, size: :medium) | ||
render_with_template(locals: { | ||
scheme:, | ||
size: | ||
}) | ||
end | ||
|
||
# @param scheme select { choices: [default,primary, danger] } "The color scheme of the button." | ||
# @param size select { choices: [small, medium] } "The size of the button." | ||
def leading_visual_svg(scheme: :primary, size: :medium) | ||
render_with_template(locals: { | ||
scheme:, | ||
size: | ||
}) | ||
end | ||
|
||
# @param scheme select { choices: [default,primary, danger] } "The color scheme of the button." | ||
# @param size select { choices: [small, medium] } "The size of the button." | ||
def trailing_visual(scheme: :primary, size: :medium) | ||
render_with_template(locals: { | ||
scheme:, | ||
size: | ||
}) | ||
end | ||
|
||
# @param scheme select { choices: [default,primary, danger] } "The color scheme of the button." | ||
# @param size select { choices: [small, medium] } "The size of the button." | ||
def trailing_visual_svg(scheme: :primary, size: :medium) | ||
render_with_template(locals: { | ||
scheme:, | ||
size: | ||
}) | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
embedded_gems/pathogen/previews/pathogen/button_preview/all_schemes.html.erb
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,13 @@ | ||
<div class="grid grid-cols-3 gap-4"> | ||
<%= render Pathogen::Button.new(scheme: :default) do %> | ||
Button | ||
<% end %> | ||
|
||
<%= render Pathogen::Button.new(scheme: :primary) do %> | ||
Button | ||
<% end %> | ||
|
||
<%= render Pathogen::Button.new(scheme: :danger) do %> | ||
Button | ||
<% end %> | ||
</div> |
3 changes: 0 additions & 3 deletions
3
embedded_gems/pathogen/previews/pathogen/button_preview/default.html.erb
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
embedded_gems/pathogen/previews/pathogen/button_preview/leading_visual.html.erb
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,4 @@ | ||
<%= render Pathogen::Button.new(scheme:, size:) do |button| %> | ||
<% button.with_leading_visual_icon(icon: "magnifying-glass") %> | ||
Search | ||
<% end %> |
11 changes: 11 additions & 0 deletions
11
embedded_gems/pathogen/previews/pathogen/button_preview/leading_visual_svg.html.erb
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,11 @@ | ||
<%= render Pathogen::Button.new(scheme:, size:) do |button| %> | ||
<% button.with_leading_visual_svg do %> | ||
<path | ||
d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z" | ||
></path><path | ||
fill-rule="evenodd" | ||
d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z" | ||
></path> | ||
<% end %> | ||
Warning | ||
<% end %> |
4 changes: 4 additions & 0 deletions
4
embedded_gems/pathogen/previews/pathogen/button_preview/trailing_visual.html.erb
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,4 @@ | ||
<%= render Pathogen::Button.new(scheme:, size:) do |button| %> | ||
<% button.with_trailing_visual_icon(icon: "arrow-right") %> | ||
Proceed | ||
<% end %> |
12 changes: 12 additions & 0 deletions
12
embedded_gems/pathogen/previews/pathogen/button_preview/trailing_visual_svg.html.erb
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 @@ | ||
<%= render Pathogen::Button.new(scheme:, size:) do |button| %> | ||
<% button.with_trailing_visual_svg do %> | ||
<path | ||
d="M8 16a2 2 0 001.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 008 16z" | ||
></path><path | ||
fill-rule="evenodd" | ||
d="M8 1.5A3.5 3.5 0 004.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.018.018 0 00-.003.01l.001.006c0 .002.002.004.004.006a.017.017 0 00.006.004l.007.001h10.964l.007-.001a.016.016 0 00.006-.004.016.016 0 00.004-.006l.001-.007a.017.017 0 00-.003-.01l-1.703-2.554a1.75 1.75 0 01-.294-.97V5A3.5 3.5 0 008 1.5zM3 5a5 5 0 0110 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.518 1.518 0 0113.482 13H2.518a1.518 1.518 0 01-1.263-2.36l1.703-2.554A.25.25 0 003 7.947V5z" | ||
></path> | ||
|
||
<% end %> | ||
Warning | ||
<% end %> |
Oops, something went wrong.