railsboot 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +45 -0
- data/Rakefile +14 -0
- data/app/assets/config/railsboot_manifest.js +1 -0
- data/app/assets/stylesheets/railsboot/application.css +15 -0
- data/app/components/railsboot/accordion/item_component.html.erb +10 -0
- data/app/components/railsboot/accordion/item_component.rb +21 -0
- data/app/components/railsboot/accordion_component.html.erb +5 -0
- data/app/components/railsboot/accordion_component.rb +15 -0
- data/app/components/railsboot/alert_component.html.erb +4 -0
- data/app/components/railsboot/alert_component.rb +21 -0
- data/app/components/railsboot/badge_component.html.erb +3 -0
- data/app/components/railsboot/badge_component.rb +15 -0
- data/app/components/railsboot/base_component.html.erb +3 -0
- data/app/components/railsboot/base_component.rb +6 -0
- data/app/components/railsboot/breadcrumb/item_component.html.erb +11 -0
- data/app/components/railsboot/breadcrumb/item_component.rb +21 -0
- data/app/components/railsboot/breadcrumb_component.html.erb +7 -0
- data/app/components/railsboot/breadcrumb_component.rb +25 -0
- data/app/components/railsboot/button/button_component.rb +5 -0
- data/app/components/railsboot/button/input_component.rb +5 -0
- data/app/components/railsboot/button/link_component.rb +5 -0
- data/app/components/railsboot/button_component.html.erb +21 -0
- data/app/components/railsboot/button_component.rb +49 -0
- data/app/components/railsboot/button_group_component.html.erb +3 -0
- data/app/components/railsboot/button_group_component.rb +24 -0
- data/app/components/railsboot/card/body_component.rb +14 -0
- data/app/components/railsboot/card/footer_component.rb +14 -0
- data/app/components/railsboot/card/header_component.rb +14 -0
- data/app/components/railsboot/card_component.html.erb +11 -0
- data/app/components/railsboot/card_component.rb +17 -0
- data/app/components/railsboot/carousel/item_component.html.erb +3 -0
- data/app/components/railsboot/carousel/item_component.rb +14 -0
- data/app/components/railsboot/carousel_component.html.erb +15 -0
- data/app/components/railsboot/carousel_component.rb +14 -0
- data/app/components/railsboot/close_button_component.html.erb +1 -0
- data/app/components/railsboot/close_button_component.rb +18 -0
- data/app/components/railsboot/component.rb +23 -0
- data/app/components/railsboot/dropdown/action_component.html.erb +5 -0
- data/app/components/railsboot/dropdown/action_component.rb +31 -0
- data/app/components/railsboot/dropdown/divider_component.html.erb +3 -0
- data/app/components/railsboot/dropdown/divider_component.rb +10 -0
- data/app/components/railsboot/dropdown/header_component.html.erb +3 -0
- data/app/components/railsboot/dropdown/header_component.rb +11 -0
- data/app/components/railsboot/dropdown/link_component.html.erb +3 -0
- data/app/components/railsboot/dropdown/link_component.rb +23 -0
- data/app/components/railsboot/dropdown_component.html.erb +9 -0
- data/app/components/railsboot/dropdown_component.rb +18 -0
- data/app/components/railsboot/heading_component.html.erb +3 -0
- data/app/components/railsboot/heading_component.rb +21 -0
- data/app/components/railsboot/list_group/item_component.rb +28 -0
- data/app/components/railsboot/list_group_component.html.erb +5 -0
- data/app/components/railsboot/list_group_component.rb +14 -0
- data/app/components/railsboot/modal/body_component.rb +14 -0
- data/app/components/railsboot/modal/footer_component.rb +14 -0
- data/app/components/railsboot/modal/header_component.html.erb +4 -0
- data/app/components/railsboot/modal/header_component.rb +10 -0
- data/app/components/railsboot/modal_component.html.erb +9 -0
- data/app/components/railsboot/modal_component.rb +27 -0
- data/app/components/railsboot/nav/item_component.html.erb +19 -0
- data/app/components/railsboot/nav/item_component.rb +32 -0
- data/app/components/railsboot/nav_component.html.erb +5 -0
- data/app/components/railsboot/nav_component.rb +23 -0
- data/app/components/railsboot/navbar/brand_component.rb +16 -0
- data/app/components/railsboot/navbar/nav_component.html.erb +5 -0
- data/app/components/railsboot/navbar/nav_component.rb +14 -0
- data/app/components/railsboot/navbar/toggler_component.html.erb +3 -0
- data/app/components/railsboot/navbar/toggler_component.rb +22 -0
- data/app/components/railsboot/navbar_component.html.erb +3 -0
- data/app/components/railsboot/navbar_component.rb +15 -0
- data/app/components/railsboot/offcanvas/body_component.rb +15 -0
- data/app/components/railsboot/offcanvas/header_component.html.erb +5 -0
- data/app/components/railsboot/offcanvas/header_component.rb +11 -0
- data/app/components/railsboot/offcanvas_component.html.erb +4 -0
- data/app/components/railsboot/offcanvas_component.rb +25 -0
- data/app/components/railsboot/pagination_component.html.erb +1 -0
- data/app/components/railsboot/pagination_component.rb +9 -0
- data/app/components/railsboot/progress_component.html.erb +3 -0
- data/app/components/railsboot/progress_component.rb +34 -0
- data/app/components/railsboot/spinner_component.html.erb +3 -0
- data/app/components/railsboot/spinner_component.rb +23 -0
- data/app/components/railsboot/table/body_component.html.erb +9 -0
- data/app/components/railsboot/table/body_component.rb +7 -0
- data/app/components/railsboot/table/cell_component.rb +13 -0
- data/app/components/railsboot/table/head_component.html.erb +9 -0
- data/app/components/railsboot/table/head_component.rb +7 -0
- data/app/components/railsboot/table/row_component.html.erb +9 -0
- data/app/components/railsboot/table/row_component.rb +7 -0
- data/app/components/railsboot/table_component.html.erb +9 -0
- data/app/components/railsboot/table_component.rb +14 -0
- data/app/components/railsboot/toast/body_component.rb +15 -0
- data/app/components/railsboot/toast/header_component.rb +17 -0
- data/app/components/railsboot/toast_component.html.erb +4 -0
- data/app/components/railsboot/toast_component.rb +21 -0
- data/app/helpers/railsboot/view_components_helper.rb +34 -0
- data/config/routes.rb +2 -0
- data/lib/railsboot/engine.rb +20 -0
- data/lib/railsboot/version.rb +3 -0
- data/lib/railsboot.rb +9 -0
- data/lib/tasks/railsboot_tasks.rake +4 -0
- metadata +196 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
class Railsboot::TableComponent < Railsboot::Component
|
2
|
+
renders_one :head, Railsboot::Table::HeadComponent
|
3
|
+
renders_one :body, Railsboot::Table::BodyComponent
|
4
|
+
|
5
|
+
def initialize(**html_attributes)
|
6
|
+
@html_attributes = html_attributes
|
7
|
+
|
8
|
+
@html_attributes[:tag] = "table"
|
9
|
+
@html_attributes[:class] = class_names(
|
10
|
+
"table",
|
11
|
+
html_attributes.delete(:class)
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class Railsboot::Toast::BodyComponent < Railsboot::Component
|
2
|
+
def initialize(**html_attributes)
|
3
|
+
@html_attributes = html_attributes
|
4
|
+
|
5
|
+
@html_attributes[:tag] = "div"
|
6
|
+
@html_attributes[:class] = class_names(
|
7
|
+
"toast-body",
|
8
|
+
html_attributes.delete(:class)
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
def call
|
13
|
+
render(Railsboot::BaseComponent.new(**@html_attributes)) { content }
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Railsboot::Toast::HeaderComponent < Railsboot::Component
|
2
|
+
def initialize(**html_attributes)
|
3
|
+
@html_attributes = html_attributes
|
4
|
+
|
5
|
+
@html_attributes[:tag] = "div"
|
6
|
+
@html_attributes[:class] = class_names(
|
7
|
+
"toast-header",
|
8
|
+
html_attributes.delete(:class)
|
9
|
+
)
|
10
|
+
end
|
11
|
+
|
12
|
+
def call
|
13
|
+
render(Railsboot::BaseComponent.new(**@html_attributes)) do
|
14
|
+
content.to_s + render(Railsboot::CloseButtonComponent.new(data: {bs_dismiss: "toast"}))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Railsboot::ToastComponent < Railsboot::Component
|
2
|
+
renders_one :header, Railsboot::Toast::HeaderComponent
|
3
|
+
renders_one :body, Railsboot::Toast::BodyComponent
|
4
|
+
|
5
|
+
def initialize(**html_attributes)
|
6
|
+
@html_attributes = html_attributes
|
7
|
+
|
8
|
+
@html_attributes[:class] = class_names(
|
9
|
+
"toast",
|
10
|
+
html_attributes.delete(:class)
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def before_render
|
17
|
+
@html_attributes["role"] = "alert"
|
18
|
+
@html_attributes["aria-live"] = "assertive"
|
19
|
+
@html_attributes["aria-atomic"] = "true"
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Railsboot
|
2
|
+
module ViewComponentsHelper
|
3
|
+
RAILSBOOT_HELPERS = {
|
4
|
+
accordion: "Railsboot::BadgeComponent",
|
5
|
+
alert: "Railsboot::AlertComponent",
|
6
|
+
badge: "Railsboot::BadgeComponent",
|
7
|
+
breadcrumb: "Railsboot::BreadcrumbComponent",
|
8
|
+
button: "Railsboot::ButtonComponent",
|
9
|
+
button_button: "Railsboot::Button::ButtonComponent",
|
10
|
+
button_input: "Railsboot::Button::InputComponent",
|
11
|
+
button_link: "Railsboot::Button::LinkComponent",
|
12
|
+
card: "Railsboot::CardComponent",
|
13
|
+
close_button: "Railsboot::CloseButtonComponent",
|
14
|
+
heading: "Railsboot::HeadingComponent",
|
15
|
+
list_group: "Railsboot::ListGroupComponent",
|
16
|
+
modal: "Railsboot::ModalComponent",
|
17
|
+
nav: "Railsboot::NavComponent",
|
18
|
+
pagination: "Railsboot::PaginationComponent",
|
19
|
+
spinner: "Railsboot::SpinnerComponent",
|
20
|
+
table: "Railsboot::TableComponent",
|
21
|
+
table_body: "Railsboot::Table::BodyComponent",
|
22
|
+
table_cell: "Railsboot::Table::CellComponent",
|
23
|
+
table_head: "Railsboot::Table::HeadComponent",
|
24
|
+
table_row: "Railsboot::Table::RowComponent",
|
25
|
+
toast: "Railsboot::Table::ToastComponent"
|
26
|
+
}
|
27
|
+
|
28
|
+
RAILSBOOT_HELPERS.each do |name, component|
|
29
|
+
define_method :"railsboot_#{name}" do |*args, **kwargs, &block|
|
30
|
+
render component.constantize.new(*args, **kwargs), &block
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "rails/engine"
|
2
|
+
require "view_component"
|
3
|
+
require "view_component/version"
|
4
|
+
|
5
|
+
module Railsboot
|
6
|
+
class Engine < ::Rails::Engine
|
7
|
+
isolate_namespace Railsboot
|
8
|
+
|
9
|
+
config.autoload_paths = %W[
|
10
|
+
#{root}/app/components
|
11
|
+
#{root}/app/helpers
|
12
|
+
]
|
13
|
+
|
14
|
+
initializer "railsboot.helpers" do
|
15
|
+
ActiveSupport.on_load(:action_controller_base) do
|
16
|
+
helper Railsboot::ViewComponentsHelper
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/railsboot.rb
ADDED
metadata
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: railsboot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Schoppmann
|
8
|
+
- Victor Cobos
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2024-06-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '7.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '7.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: view_component
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 3.0.0
|
35
|
+
- - "<"
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 4.0.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 3.0.0
|
45
|
+
- - "<"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 4.0.0
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: minitest
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
description:
|
63
|
+
email:
|
64
|
+
- daniel.schoppmann@dotruby.com
|
65
|
+
- victor.cobos@dotruby.com
|
66
|
+
executables: []
|
67
|
+
extensions: []
|
68
|
+
extra_rdoc_files: []
|
69
|
+
files:
|
70
|
+
- MIT-LICENSE
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- app/assets/config/railsboot_manifest.js
|
74
|
+
- app/assets/stylesheets/railsboot/application.css
|
75
|
+
- app/components/railsboot/accordion/item_component.html.erb
|
76
|
+
- app/components/railsboot/accordion/item_component.rb
|
77
|
+
- app/components/railsboot/accordion_component.html.erb
|
78
|
+
- app/components/railsboot/accordion_component.rb
|
79
|
+
- app/components/railsboot/alert_component.html.erb
|
80
|
+
- app/components/railsboot/alert_component.rb
|
81
|
+
- app/components/railsboot/badge_component.html.erb
|
82
|
+
- app/components/railsboot/badge_component.rb
|
83
|
+
- app/components/railsboot/base_component.html.erb
|
84
|
+
- app/components/railsboot/base_component.rb
|
85
|
+
- app/components/railsboot/breadcrumb/item_component.html.erb
|
86
|
+
- app/components/railsboot/breadcrumb/item_component.rb
|
87
|
+
- app/components/railsboot/breadcrumb_component.html.erb
|
88
|
+
- app/components/railsboot/breadcrumb_component.rb
|
89
|
+
- app/components/railsboot/button/button_component.rb
|
90
|
+
- app/components/railsboot/button/input_component.rb
|
91
|
+
- app/components/railsboot/button/link_component.rb
|
92
|
+
- app/components/railsboot/button_component.html.erb
|
93
|
+
- app/components/railsboot/button_component.rb
|
94
|
+
- app/components/railsboot/button_group_component.html.erb
|
95
|
+
- app/components/railsboot/button_group_component.rb
|
96
|
+
- app/components/railsboot/card/body_component.rb
|
97
|
+
- app/components/railsboot/card/footer_component.rb
|
98
|
+
- app/components/railsboot/card/header_component.rb
|
99
|
+
- app/components/railsboot/card_component.html.erb
|
100
|
+
- app/components/railsboot/card_component.rb
|
101
|
+
- app/components/railsboot/carousel/item_component.html.erb
|
102
|
+
- app/components/railsboot/carousel/item_component.rb
|
103
|
+
- app/components/railsboot/carousel_component.html.erb
|
104
|
+
- app/components/railsboot/carousel_component.rb
|
105
|
+
- app/components/railsboot/close_button_component.html.erb
|
106
|
+
- app/components/railsboot/close_button_component.rb
|
107
|
+
- app/components/railsboot/component.rb
|
108
|
+
- app/components/railsboot/dropdown/action_component.html.erb
|
109
|
+
- app/components/railsboot/dropdown/action_component.rb
|
110
|
+
- app/components/railsboot/dropdown/divider_component.html.erb
|
111
|
+
- app/components/railsboot/dropdown/divider_component.rb
|
112
|
+
- app/components/railsboot/dropdown/header_component.html.erb
|
113
|
+
- app/components/railsboot/dropdown/header_component.rb
|
114
|
+
- app/components/railsboot/dropdown/link_component.html.erb
|
115
|
+
- app/components/railsboot/dropdown/link_component.rb
|
116
|
+
- app/components/railsboot/dropdown_component.html.erb
|
117
|
+
- app/components/railsboot/dropdown_component.rb
|
118
|
+
- app/components/railsboot/heading_component.html.erb
|
119
|
+
- app/components/railsboot/heading_component.rb
|
120
|
+
- app/components/railsboot/list_group/item_component.rb
|
121
|
+
- app/components/railsboot/list_group_component.html.erb
|
122
|
+
- app/components/railsboot/list_group_component.rb
|
123
|
+
- app/components/railsboot/modal/body_component.rb
|
124
|
+
- app/components/railsboot/modal/footer_component.rb
|
125
|
+
- app/components/railsboot/modal/header_component.html.erb
|
126
|
+
- app/components/railsboot/modal/header_component.rb
|
127
|
+
- app/components/railsboot/modal_component.html.erb
|
128
|
+
- app/components/railsboot/modal_component.rb
|
129
|
+
- app/components/railsboot/nav/item_component.html.erb
|
130
|
+
- app/components/railsboot/nav/item_component.rb
|
131
|
+
- app/components/railsboot/nav_component.html.erb
|
132
|
+
- app/components/railsboot/nav_component.rb
|
133
|
+
- app/components/railsboot/navbar/brand_component.rb
|
134
|
+
- app/components/railsboot/navbar/nav_component.html.erb
|
135
|
+
- app/components/railsboot/navbar/nav_component.rb
|
136
|
+
- app/components/railsboot/navbar/toggler_component.html.erb
|
137
|
+
- app/components/railsboot/navbar/toggler_component.rb
|
138
|
+
- app/components/railsboot/navbar_component.html.erb
|
139
|
+
- app/components/railsboot/navbar_component.rb
|
140
|
+
- app/components/railsboot/offcanvas/body_component.rb
|
141
|
+
- app/components/railsboot/offcanvas/header_component.html.erb
|
142
|
+
- app/components/railsboot/offcanvas/header_component.rb
|
143
|
+
- app/components/railsboot/offcanvas_component.html.erb
|
144
|
+
- app/components/railsboot/offcanvas_component.rb
|
145
|
+
- app/components/railsboot/pagination_component.html.erb
|
146
|
+
- app/components/railsboot/pagination_component.rb
|
147
|
+
- app/components/railsboot/progress_component.html.erb
|
148
|
+
- app/components/railsboot/progress_component.rb
|
149
|
+
- app/components/railsboot/spinner_component.html.erb
|
150
|
+
- app/components/railsboot/spinner_component.rb
|
151
|
+
- app/components/railsboot/table/body_component.html.erb
|
152
|
+
- app/components/railsboot/table/body_component.rb
|
153
|
+
- app/components/railsboot/table/cell_component.rb
|
154
|
+
- app/components/railsboot/table/head_component.html.erb
|
155
|
+
- app/components/railsboot/table/head_component.rb
|
156
|
+
- app/components/railsboot/table/row_component.html.erb
|
157
|
+
- app/components/railsboot/table/row_component.rb
|
158
|
+
- app/components/railsboot/table_component.html.erb
|
159
|
+
- app/components/railsboot/table_component.rb
|
160
|
+
- app/components/railsboot/toast/body_component.rb
|
161
|
+
- app/components/railsboot/toast/header_component.rb
|
162
|
+
- app/components/railsboot/toast_component.html.erb
|
163
|
+
- app/components/railsboot/toast_component.rb
|
164
|
+
- app/helpers/railsboot/view_components_helper.rb
|
165
|
+
- config/routes.rb
|
166
|
+
- lib/railsboot.rb
|
167
|
+
- lib/railsboot/engine.rb
|
168
|
+
- lib/railsboot/version.rb
|
169
|
+
- lib/tasks/railsboot_tasks.rake
|
170
|
+
homepage: https://railsbootui.com
|
171
|
+
licenses:
|
172
|
+
- MIT
|
173
|
+
metadata:
|
174
|
+
allowed_push_host: https://rubygems.org
|
175
|
+
homepage_uri: https://railsbootui.com
|
176
|
+
source_code_uri: https://github.com/dotruby/railsboot
|
177
|
+
post_install_message:
|
178
|
+
rdoc_options: []
|
179
|
+
require_paths:
|
180
|
+
- lib
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: 3.0.0
|
186
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
requirements: []
|
192
|
+
rubygems_version: 3.5.3
|
193
|
+
signing_key:
|
194
|
+
specification_version: 4
|
195
|
+
summary: Rails View Components for Bootstrap
|
196
|
+
test_files: []
|