-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add navigation and form components. * Add dark mode.
- Loading branch information
1 parent
c98fb67
commit 217dd13
Showing
30 changed files
with
423 additions
and
108 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 @@ | ||
[multiple]:focus, [type=date]:focus, [type=datetime-local]:focus, [type=email]:focus, [type=month]:focus, [type=number]:focus, | ||
[type=password]:focus, [type=search]:focus, [type=tel]:focus, [type=text]:focus, [type=time]:focus, [type=url]:focus, | ||
[type=week]:focus, select:focus, textarea:focus, trix-editor:focus { | ||
border-color: hsl(var(--primary)); | ||
--tw-ring-color: hsl(var(--primary)); | ||
--tw-ring-color: hsl(var(--primary)); | ||
} | ||
|
||
[multiple], [type=date], [type=datetime-local], [type=email], [type=month], [type=number], [type=password], [type=search], [type=tel], [type=text], [type=time], [type=url], [type=week], select, textarea { | ||
background-color: inherit; | ||
} | ||
|
||
trix-editor:focus { | ||
border-color: hsl(var(--primary)); | ||
--tw-ring-color: hsl(var(--primary)); | ||
border-width: 2px; | ||
} |
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,47 @@ | ||
@font-face { | ||
font-family: 'Montserrat'; | ||
src: url('montserrat/Montserrat-VariableFont_wght.ttf') format('truetype'); | ||
font-weight: 100 900; | ||
font-stretch: 75% 125%; | ||
font-style: normal; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Open Sans'; | ||
src: url('open-sans/OpenSans-VariableFont_wdth,wght.ttf') format('truetype'); | ||
font-weight: 300 800; | ||
font-stretch: 75% 125%; | ||
font-style: normal; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Montserrat'; | ||
src: url('montserrat/Montserrat-Italic-VariableFont_wght.ttf') format('truetype'); | ||
font-weight: 100 900; | ||
font-stretch: 75% 125%; | ||
font-style: italic; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Open Sans'; | ||
src: url('open-sans/OpenSans-Italic-VariableFont_wdth,wght.ttf') format('truetype'); | ||
font-weight: 300 800; | ||
font-stretch: 75% 125%; | ||
font-style: italic; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
font-family: 'Special Elite'; | ||
src: url('special-elite/SpecialElite-Regular.ttf') format('truetype'); | ||
font-weight: 400; | ||
font-style: normal; | ||
font-display: swap; | ||
} | ||
|
||
.font-special-elite { | ||
font-family: 'Special Elite', cursive; | ||
} |
6 changes: 4 additions & 2 deletions
6
...views/components/application_component.rb → app/components/base.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
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,26 @@ | ||
# frozen_string_literal: true | ||
|
||
class Components::ConfirmDialog < Components::Base | ||
def initialize(**options) | ||
@options = options | ||
super() | ||
end | ||
|
||
def view_template(&) | ||
render RBUI::AlertDialog.new do | ||
render RBUI::AlertDialogTrigger.new do | ||
RBUI::Button(**@options, &) | ||
end | ||
render RBUI::AlertDialogContent.new do | ||
render RBUI::AlertDialogHeader.new do | ||
render RBUI::AlertDialogTitle.new { @options[:title] || "Are you sure?" } | ||
render RBUI::AlertDialogDescription.new { @options[:description] } | ||
end | ||
render RBUI::AlertDialogFooter.new do | ||
render RBUI::AlertDialogCancel.new { @options[:cancel_text] || "Cancel" } | ||
render RBUI::Link.new(**@options) { @options[:action_text] || "Proceed" } | ||
end | ||
end | ||
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,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class Components::InlineSvg < Components::Base | ||
def initialize(filepath) | ||
@filepath = filepath | ||
end | ||
|
||
def svg_data | ||
raw( | ||
Rails.application.assets.load_path.find(@filepath).content.html_safe | ||
) | ||
end | ||
|
||
def view_template | ||
safe(svg_data) | ||
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,43 @@ | ||
# frozen_string_literal: true | ||
|
||
class Components::NavThemeToggle < Components::Base | ||
def view_template | ||
render RBUI::ThemeToggle.new do |toggle| | ||
toggle.light_mode do | ||
RBUI::Button(variant: :ghost) do | ||
svg( | ||
xmlns: "http://www.w3.org/2000/svg", | ||
viewbox: "0 0 24 24", | ||
fill: "currentColor", | ||
class: "w-4 h-4 hidden md:block" | ||
) do |s| | ||
s.path( | ||
fill_rule: "evenodd", | ||
d: | ||
"M9.528 1.718a.75.75 0 01.162.819A8.97 8.97 0 009 6a9 9 0 009 9 8.97 8.97 0 003.463-.69.75.75 0 01.981.98 10.503 10.503 0 01-9.694 6.46c-5.799 0-10.5-4.701-10.5-10.5 0-4.368 2.667-8.112 6.46-9.694a.75.75 0 01.818.162z", | ||
clip_rule: "evenodd" | ||
) | ||
end | ||
span(class: "block md:hidden") { "Dark Mode" } | ||
end | ||
end | ||
|
||
toggle.dark_mode do | ||
RBUI::Button(variant: :ghost) do | ||
svg( | ||
xmlns: "http://www.w3.org/2000/svg", | ||
viewbox: "0 0 24 24", | ||
fill: "currentColor", | ||
class: "w-4 h-4 hidden md:block" | ||
) do |s| | ||
s.path( | ||
d: | ||
"M12 2.25a.75.75 0 01.75.75v2.25a.75.75 0 01-1.5 0V3a.75.75 0 01.75-.75zM7.5 12a4.5 4.5 0 119 0 4.5 4.5 0 01-9 0zM18.894 6.166a.75.75 0 00-1.06-1.06l-1.591 1.59a.75.75 0 101.06 1.061l1.591-1.59zM21.75 12a.75.75 0 01-.75.75h-2.25a.75.75 0 010-1.5H21a.75.75 0 01.75.75zM17.834 18.894a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 10-1.061 1.06l1.59 1.591zM12 18a.75.75 0 01.75.75V21a.75.75 0 01-1.5 0v-2.25A.75.75 0 0112 18zM7.758 17.303a.75.75 0 00-1.061-1.06l-1.591 1.59a.75.75 0 001.06 1.061l1.591-1.59zM6 12a.75.75 0 01-.75.75H3a.75.75 0 010-1.5h2.25A.75.75 0 016 12zM6.697 7.757a.75.75 0 001.06-1.06l-1.59-1.591a.75.75 0 00-1.061 1.06l1.59 1.591z" | ||
) | ||
end | ||
span(class: "block md:hidden") { "Light Mode" } | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.