better_ui 0.1.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +65 -1
- data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +138 -0
- data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +211 -0
- data/app/assets/javascripts/better_ui/controllers/toast_controller.js +161 -0
- data/app/assets/javascripts/better_ui/index.js +159 -0
- data/app/assets/javascripts/better_ui/toast_manager.js +77 -0
- data/app/assets/stylesheets/better_ui/application.css +25 -351
- data/app/components/better_ui/application/alert_component.html.erb +27 -0
- data/app/components/better_ui/application/alert_component.rb +196 -0
- data/app/components/better_ui/application/header_component.html.erb +88 -0
- data/app/components/better_ui/application/header_component.rb +188 -0
- data/app/components/better_ui/application/navbar_component.html.erb +294 -0
- data/app/components/better_ui/application/navbar_component.rb +249 -0
- data/app/components/better_ui/application/sidebar_component.html.erb +207 -0
- data/app/components/better_ui/application/sidebar_component.rb +318 -0
- data/app/components/better_ui/application/toast_component.html.erb +35 -0
- data/app/components/better_ui/application/toast_component.rb +188 -0
- data/app/components/better_ui/general/breadcrumb_component.html.erb +39 -0
- data/app/components/better_ui/general/breadcrumb_component.rb +132 -0
- data/app/components/better_ui/general/button_component.html.erb +34 -0
- data/app/components/better_ui/general/button_component.rb +193 -0
- data/app/components/better_ui/general/heading_component.html.erb +25 -0
- data/app/components/better_ui/general/heading_component.rb +142 -0
- data/app/components/better_ui/general/icon_component.html.erb +2 -0
- data/app/components/better_ui/general/icon_component.rb +101 -0
- data/app/components/better_ui/general/panel_component.html.erb +27 -0
- data/app/components/better_ui/general/panel_component.rb +97 -0
- data/app/components/better_ui/general/table_component.html.erb +37 -0
- data/app/components/better_ui/general/table_component.rb +141 -0
- data/app/components/better_ui/theme_helper.rb +169 -0
- data/app/controllers/better_ui/application_controller.rb +1 -0
- data/app/controllers/better_ui/docs_controller.rb +18 -25
- data/app/helpers/better_ui_application_helper.rb +99 -0
- data/app/views/layouts/component_preview.html.erb +32 -0
- data/config/initializers/lookbook.rb +23 -0
- data/config/routes.rb +6 -1
- data/lib/better_ui/engine.rb +24 -1
- data/lib/better_ui/version.rb +1 -1
- metadata +103 -7
- data/app/helpers/better_ui/application_helper.rb +0 -183
- data/app/views/better_ui/docs/component.html.erb +0 -365
- data/app/views/better_ui/docs/index.html.erb +0 -100
- data/app/views/better_ui/docs/show.html.erb +0 -60
- data/app/views/layouts/better_ui/application.html.erb +0 -135
@@ -1,183 +0,0 @@
|
|
1
|
-
module BetterUi
|
2
|
-
module ApplicationHelper
|
3
|
-
# Metodi helper per i componenti UI semplici
|
4
|
-
|
5
|
-
# Button component
|
6
|
-
def better_ui_button(text, options = {})
|
7
|
-
options = BetterUi.configuration.button_defaults.deep_merge(options)
|
8
|
-
type = options.delete(:type) || 'primary'
|
9
|
-
css_class = "better-ui-button better-ui-button-#{type}"
|
10
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
11
|
-
|
12
|
-
button_tag(text, **options.merge(class: css_class))
|
13
|
-
end
|
14
|
-
|
15
|
-
# Alert component
|
16
|
-
def better_ui_alert(message, options = {})
|
17
|
-
options = BetterUi.configuration.alert_defaults.deep_merge(options)
|
18
|
-
type = options.delete(:type) || 'info'
|
19
|
-
css_class = "better-ui-alert better-ui-alert-#{type}"
|
20
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
21
|
-
|
22
|
-
content_tag(:div, class: css_class) do
|
23
|
-
concat content_tag(:div, message, class: 'better-ui-alert-message')
|
24
|
-
if options[:dismissible]
|
25
|
-
concat content_tag(:button, 'x', class: 'better-ui-alert-close')
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
# Card component
|
31
|
-
def better_ui_card(options = {}, &block)
|
32
|
-
options = BetterUi.configuration.card_defaults.deep_merge(options)
|
33
|
-
css_class = "better-ui-card"
|
34
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
35
|
-
|
36
|
-
content_tag(:div, class: css_class, **options, &block)
|
37
|
-
end
|
38
|
-
|
39
|
-
# Card header
|
40
|
-
def better_ui_card_header(title, options = {})
|
41
|
-
css_class = "better-ui-card-header"
|
42
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
43
|
-
|
44
|
-
content_tag(:div, class: css_class) do
|
45
|
-
content_tag(:h3, title, class: 'better-ui-card-title')
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Card body
|
50
|
-
def better_ui_card_body(options = {}, &block)
|
51
|
-
css_class = "better-ui-card-body"
|
52
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
53
|
-
|
54
|
-
content_tag(:div, class: css_class, **options, &block)
|
55
|
-
end
|
56
|
-
|
57
|
-
# Card footer
|
58
|
-
def better_ui_card_footer(options = {}, &block)
|
59
|
-
css_class = "better-ui-card-footer"
|
60
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
61
|
-
|
62
|
-
content_tag(:div, class: css_class, **options, &block)
|
63
|
-
end
|
64
|
-
|
65
|
-
# Tabs component
|
66
|
-
def better_ui_tabs(options = {}, &block)
|
67
|
-
options = BetterUi.configuration.tabs_defaults.deep_merge(options)
|
68
|
-
css_class = "better-ui-tabs"
|
69
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
70
|
-
|
71
|
-
content_tag(:div, class: css_class, **options, &block)
|
72
|
-
end
|
73
|
-
|
74
|
-
# Tab list
|
75
|
-
def better_ui_tab_list(options = {}, &block)
|
76
|
-
css_class = "better-ui-tab-list"
|
77
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
78
|
-
|
79
|
-
content_tag(:div, class: css_class, role: 'tablist', **options, &block)
|
80
|
-
end
|
81
|
-
|
82
|
-
# Tab item
|
83
|
-
def better_ui_tab_item(text, target, options = {})
|
84
|
-
active = options.delete(:active) || false
|
85
|
-
css_class = "better-ui-tab-item"
|
86
|
-
css_class += " better-ui-tab-active" if active
|
87
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
88
|
-
|
89
|
-
content_tag(:button, text, {
|
90
|
-
class: css_class,
|
91
|
-
role: 'tab',
|
92
|
-
'aria-selected': active,
|
93
|
-
'data-target': target,
|
94
|
-
}.merge(options))
|
95
|
-
end
|
96
|
-
|
97
|
-
# Tab content
|
98
|
-
def better_ui_tab_content(options = {}, &block)
|
99
|
-
css_class = "better-ui-tab-content"
|
100
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
101
|
-
|
102
|
-
content_tag(:div, class: css_class, role: 'tabpanel', **options, &block)
|
103
|
-
end
|
104
|
-
|
105
|
-
# Modal component
|
106
|
-
def better_ui_modal(id, options = {}, &block)
|
107
|
-
css_class = "better-ui-modal"
|
108
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
109
|
-
|
110
|
-
content_tag(:div, id: id, class: css_class) do
|
111
|
-
concat content_tag(:div, '', class: 'better-ui-modal-background')
|
112
|
-
concat content_tag(:div, class: 'better-ui-modal-dialog', &block)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
# Modal header
|
117
|
-
def better_ui_modal_header(title, options = {})
|
118
|
-
css_class = "better-ui-modal-header"
|
119
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
120
|
-
|
121
|
-
content_tag(:div, class: css_class) do
|
122
|
-
concat content_tag(:h5, title, class: 'better-ui-modal-title')
|
123
|
-
concat content_tag(:button, '×', type: 'button', class: 'better-ui-modal-close')
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
# Modal body
|
128
|
-
def better_ui_modal_body(options = {}, &block)
|
129
|
-
css_class = "better-ui-modal-body"
|
130
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
131
|
-
|
132
|
-
content_tag(:div, class: css_class, **options, &block)
|
133
|
-
end
|
134
|
-
|
135
|
-
# Modal footer
|
136
|
-
def better_ui_modal_footer(options = {}, &block)
|
137
|
-
css_class = "better-ui-modal-footer"
|
138
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
139
|
-
|
140
|
-
content_tag(:div, class: css_class, **options, &block)
|
141
|
-
end
|
142
|
-
|
143
|
-
# Trigger button for modal
|
144
|
-
def better_ui_modal_trigger(text, modal_id, options = {})
|
145
|
-
options = BetterUi.configuration.button_defaults.deep_merge(options)
|
146
|
-
type = options.delete(:type) || 'primary'
|
147
|
-
css_class = "better-ui-button better-ui-button-#{type}"
|
148
|
-
css_class += " #{options.delete(:class)}" if options[:class]
|
149
|
-
|
150
|
-
button_tag(text, **options.merge(
|
151
|
-
class: css_class,
|
152
|
-
type: 'button',
|
153
|
-
onclick: "document.getElementById('#{modal_id}').style.display='flex'"
|
154
|
-
))
|
155
|
-
end
|
156
|
-
|
157
|
-
# Render markdown
|
158
|
-
def better_ui_markdown(text)
|
159
|
-
return '' if text.blank?
|
160
|
-
|
161
|
-
renderer = Redcarpet::Render::HTML.new(
|
162
|
-
filter_html: false,
|
163
|
-
hard_wrap: true,
|
164
|
-
link_attributes: { target: '_blank', rel: 'noopener noreferrer' }
|
165
|
-
)
|
166
|
-
|
167
|
-
markdown = Redcarpet::Markdown.new(
|
168
|
-
renderer,
|
169
|
-
autolink: true,
|
170
|
-
tables: true,
|
171
|
-
fenced_code_blocks: true,
|
172
|
-
strikethrough: true,
|
173
|
-
superscript: true,
|
174
|
-
underline: true,
|
175
|
-
highlight: true,
|
176
|
-
quote: true,
|
177
|
-
footnotes: true
|
178
|
-
)
|
179
|
-
|
180
|
-
markdown.render(text).html_safe
|
181
|
-
end
|
182
|
-
end
|
183
|
-
end
|
@@ -1,365 +0,0 @@
|
|
1
|
-
<% content_for :title, @component_name.titleize + ' - Documentazione' %>
|
2
|
-
|
3
|
-
<div class="better-ui-doc-content">
|
4
|
-
<%= better_ui_markdown(@content) %>
|
5
|
-
</div>
|
6
|
-
|
7
|
-
<div class="better-ui-component-examples">
|
8
|
-
<h2>Esempi</h2>
|
9
|
-
|
10
|
-
<% case @component_name %>
|
11
|
-
<% when 'button' %>
|
12
|
-
<div class="better-ui-example">
|
13
|
-
<h3>Tipi di Button</h3>
|
14
|
-
<div class="better-ui-example-preview">
|
15
|
-
<%= better_ui_button("Primary", type: 'primary') %>
|
16
|
-
<%= better_ui_button("Secondary", type: 'secondary') %>
|
17
|
-
<%= better_ui_button("Success", type: 'success') %>
|
18
|
-
<%= better_ui_button("Danger", type: 'danger') %>
|
19
|
-
</div>
|
20
|
-
<div class="better-ui-example-code">
|
21
|
-
<pre><code><%= better_ui_button("Primary", type: 'primary') %>
|
22
|
-
<%= better_ui_button("Secondary", type: 'secondary') %>
|
23
|
-
<%= better_ui_button("Success", type: 'success') %>
|
24
|
-
<%= better_ui_button("Danger", type: 'danger') %></code></pre>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
<% when 'alert' %>
|
28
|
-
<div class="better-ui-example">
|
29
|
-
<h3>Tipi di Alert</h3>
|
30
|
-
<div class="better-ui-example-preview">
|
31
|
-
<%= better_ui_alert("Questo è un alert informativo", type: 'info') %>
|
32
|
-
<%= better_ui_alert("Operazione completata con successo", type: 'success') %>
|
33
|
-
<%= better_ui_alert("Attenzione: questa è un'azione importante", type: 'warning') %>
|
34
|
-
<%= better_ui_alert("Si è verificato un errore", type: 'danger') %>
|
35
|
-
</div>
|
36
|
-
<div class="better-ui-example-code">
|
37
|
-
<pre><code><%= better_ui_alert("Questo è un alert informativo", type: 'info') %>
|
38
|
-
<%= better_ui_alert("Operazione completata con successo", type: 'success') %>
|
39
|
-
<%= better_ui_alert("Attenzione: questa è un'azione importante", type: 'warning') %>
|
40
|
-
<%= better_ui_alert("Si è verificato un errore", type: 'danger') %></code></pre>
|
41
|
-
</div>
|
42
|
-
</div>
|
43
|
-
<% when 'card' %>
|
44
|
-
<div class="better-ui-example">
|
45
|
-
<h3>Card con Titolo e Corpo</h3>
|
46
|
-
<div class="better-ui-example-preview">
|
47
|
-
<%= better_ui_card do %>
|
48
|
-
<%= better_ui_card_header("Titolo della Card") %>
|
49
|
-
<%= better_ui_card_body do %>
|
50
|
-
<p>Questo è il contenuto della card. Puoi inserire qualsiasi elemento HTML qui.</p>
|
51
|
-
<% end %>
|
52
|
-
<% end %>
|
53
|
-
</div>
|
54
|
-
<div class="better-ui-example-code">
|
55
|
-
<pre><code><%= better_ui_card do %>
|
56
|
-
<%= better_ui_card_header("Titolo della Card") %>
|
57
|
-
<%= better_ui_card_body do %>
|
58
|
-
<p>Questo è il contenuto della card. Puoi inserire qualsiasi elemento HTML qui.</p>
|
59
|
-
<% end %>
|
60
|
-
<% end %></code></pre>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<div class="better-ui-example">
|
65
|
-
<h3>Card con Footer</h3>
|
66
|
-
<div class="better-ui-example-preview">
|
67
|
-
<%= better_ui_card do %>
|
68
|
-
<%= better_ui_card_header("Titolo della Card") %>
|
69
|
-
<%= better_ui_card_body do %>
|
70
|
-
<p>Questo è il contenuto della card. Puoi inserire qualsiasi elemento HTML qui.</p>
|
71
|
-
<% end %>
|
72
|
-
<%= better_ui_card_footer do %>
|
73
|
-
<%= better_ui_button("Salva", type: 'primary') %>
|
74
|
-
<%= better_ui_button("Annulla", type: 'secondary') %>
|
75
|
-
<% end %>
|
76
|
-
<% end %>
|
77
|
-
</div>
|
78
|
-
<div class="better-ui-example-code">
|
79
|
-
<pre><code><%= better_ui_card do %>
|
80
|
-
<%= better_ui_card_header("Titolo della Card") %>
|
81
|
-
<%= better_ui_card_body do %>
|
82
|
-
<p>Questo è il contenuto della card. Puoi inserire qualsiasi elemento HTML qui.</p>
|
83
|
-
<% end %>
|
84
|
-
<%= better_ui_card_footer do %>
|
85
|
-
<%= better_ui_button("Salva", type: 'primary') %>
|
86
|
-
<%= better_ui_button("Annulla", type: 'secondary') %>
|
87
|
-
<% end %>
|
88
|
-
<% end %></code></pre>
|
89
|
-
</div>
|
90
|
-
</div>
|
91
|
-
<% when 'tabs' %>
|
92
|
-
<div class="better-ui-example">
|
93
|
-
<h3>Tabs Base</h3>
|
94
|
-
<div class="better-ui-example-preview">
|
95
|
-
<%= better_ui_tabs do %>
|
96
|
-
<%= better_ui_tab_list do %>
|
97
|
-
<%= better_ui_tab_item("Tab 1", "#tab1", active: true) %>
|
98
|
-
<%= better_ui_tab_item("Tab 2", "#tab2") %>
|
99
|
-
<%= better_ui_tab_item("Tab 3", "#tab3") %>
|
100
|
-
<% end %>
|
101
|
-
|
102
|
-
<div class="better-ui-tab-panels">
|
103
|
-
<%= better_ui_tab_content(id: 'tab1', class: 'active') do %>
|
104
|
-
<p>Contenuto del Tab 1</p>
|
105
|
-
<% end %>
|
106
|
-
|
107
|
-
<%= better_ui_tab_content(id: 'tab2', style: 'display: none;') do %>
|
108
|
-
<p>Contenuto del Tab 2</p>
|
109
|
-
<% end %>
|
110
|
-
|
111
|
-
<%= better_ui_tab_content(id: 'tab3', style: 'display: none;') do %>
|
112
|
-
<p>Contenuto del Tab 3</p>
|
113
|
-
<% end %>
|
114
|
-
</div>
|
115
|
-
<% end %>
|
116
|
-
</div>
|
117
|
-
<div class="better-ui-example-code">
|
118
|
-
<pre><code><%= better_ui_tabs do %>
|
119
|
-
<%= better_ui_tab_list do %>
|
120
|
-
<%= better_ui_tab_item("Tab 1", "#tab1", active: true) %>
|
121
|
-
<%= better_ui_tab_item("Tab 2", "#tab2") %>
|
122
|
-
<%= better_ui_tab_item("Tab 3", "#tab3") %>
|
123
|
-
<% end %>
|
124
|
-
|
125
|
-
<div class="better-ui-tab-panels">
|
126
|
-
<%= better_ui_tab_content(id: 'tab1', class: 'active') do %>
|
127
|
-
<p>Contenuto del Tab 1</p>
|
128
|
-
<% end %>
|
129
|
-
|
130
|
-
<%= better_ui_tab_content(id: 'tab2', style: 'display: none;') do %>
|
131
|
-
<p>Contenuto del Tab 2</p>
|
132
|
-
<% end %>
|
133
|
-
|
134
|
-
<%= better_ui_tab_content(id: 'tab3', style: 'display: none;') do %>
|
135
|
-
<p>Contenuto del Tab 3</p>
|
136
|
-
<% end %>
|
137
|
-
</div>
|
138
|
-
<% end %></code></pre>
|
139
|
-
</div>
|
140
|
-
</div>
|
141
|
-
<% else %>
|
142
|
-
<div class="better-ui-example">
|
143
|
-
<p>Gli esempi per questo componente saranno disponibili presto.</p>
|
144
|
-
</div>
|
145
|
-
<% end %>
|
146
|
-
</div>
|
147
|
-
|
148
|
-
<style>
|
149
|
-
.better-ui-doc-content {
|
150
|
-
max-width: 100%;
|
151
|
-
margin-bottom: 2rem;
|
152
|
-
}
|
153
|
-
|
154
|
-
.better-ui-doc-content h1 {
|
155
|
-
margin-bottom: 1.5rem;
|
156
|
-
padding-bottom: 0.5rem;
|
157
|
-
border-bottom: 1px solid #e0e0e0;
|
158
|
-
}
|
159
|
-
|
160
|
-
.better-ui-doc-content h2 {
|
161
|
-
margin-top: 2rem;
|
162
|
-
margin-bottom: 1rem;
|
163
|
-
padding-bottom: 0.5rem;
|
164
|
-
border-bottom: 1px solid #f0f0f0;
|
165
|
-
}
|
166
|
-
|
167
|
-
.better-ui-doc-content pre {
|
168
|
-
background-color: #f5f5f5;
|
169
|
-
padding: 1rem;
|
170
|
-
border-radius: 4px;
|
171
|
-
overflow-x: auto;
|
172
|
-
margin: 1rem 0;
|
173
|
-
}
|
174
|
-
|
175
|
-
.better-ui-doc-content code {
|
176
|
-
font-family: monospace;
|
177
|
-
}
|
178
|
-
|
179
|
-
.better-ui-component-examples {
|
180
|
-
margin-top: 2rem;
|
181
|
-
border-top: 1px solid #e0e0e0;
|
182
|
-
padding-top: 1rem;
|
183
|
-
}
|
184
|
-
|
185
|
-
.better-ui-example {
|
186
|
-
margin-bottom: 2rem;
|
187
|
-
border: 1px solid #e0e0e0;
|
188
|
-
border-radius: 4px;
|
189
|
-
overflow: hidden;
|
190
|
-
}
|
191
|
-
|
192
|
-
.better-ui-example h3 {
|
193
|
-
margin: 0;
|
194
|
-
padding: 1rem;
|
195
|
-
background-color: #f9f9f9;
|
196
|
-
border-bottom: 1px solid #e0e0e0;
|
197
|
-
}
|
198
|
-
|
199
|
-
.better-ui-example-preview {
|
200
|
-
padding: 1.5rem;
|
201
|
-
border-bottom: 1px solid #e0e0e0;
|
202
|
-
}
|
203
|
-
|
204
|
-
.better-ui-example-code {
|
205
|
-
padding: 0;
|
206
|
-
margin: 0;
|
207
|
-
background-color: #f5f5f5;
|
208
|
-
}
|
209
|
-
|
210
|
-
.better-ui-example-code pre {
|
211
|
-
margin: 0;
|
212
|
-
border-radius: 0;
|
213
|
-
}
|
214
|
-
|
215
|
-
/* Stili per i componenti */
|
216
|
-
.better-ui-button {
|
217
|
-
display: inline-block;
|
218
|
-
font-weight: 400;
|
219
|
-
text-align: center;
|
220
|
-
white-space: nowrap;
|
221
|
-
vertical-align: middle;
|
222
|
-
user-select: none;
|
223
|
-
border: 1px solid transparent;
|
224
|
-
padding: 0.5rem 1rem;
|
225
|
-
font-size: 1rem;
|
226
|
-
line-height: 1.5;
|
227
|
-
border-radius: 0.25rem;
|
228
|
-
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
|
229
|
-
margin-right: 0.5rem;
|
230
|
-
cursor: pointer;
|
231
|
-
}
|
232
|
-
|
233
|
-
.better-ui-button-primary {
|
234
|
-
color: #fff;
|
235
|
-
background-color: #007bff;
|
236
|
-
border-color: #007bff;
|
237
|
-
}
|
238
|
-
|
239
|
-
.better-ui-button-secondary {
|
240
|
-
color: #fff;
|
241
|
-
background-color: #6c757d;
|
242
|
-
border-color: #6c757d;
|
243
|
-
}
|
244
|
-
|
245
|
-
.better-ui-button-success {
|
246
|
-
color: #fff;
|
247
|
-
background-color: #28a745;
|
248
|
-
border-color: #28a745;
|
249
|
-
}
|
250
|
-
|
251
|
-
.better-ui-button-danger {
|
252
|
-
color: #fff;
|
253
|
-
background-color: #dc3545;
|
254
|
-
border-color: #dc3545;
|
255
|
-
}
|
256
|
-
|
257
|
-
.better-ui-alert {
|
258
|
-
position: relative;
|
259
|
-
padding: 1rem;
|
260
|
-
margin-bottom: 1rem;
|
261
|
-
border: 1px solid transparent;
|
262
|
-
border-radius: 0.25rem;
|
263
|
-
}
|
264
|
-
|
265
|
-
.better-ui-alert-info {
|
266
|
-
color: #0c5460;
|
267
|
-
background-color: #d1ecf1;
|
268
|
-
border-color: #bee5eb;
|
269
|
-
}
|
270
|
-
|
271
|
-
.better-ui-alert-success {
|
272
|
-
color: #155724;
|
273
|
-
background-color: #d4edda;
|
274
|
-
border-color: #c3e6cb;
|
275
|
-
}
|
276
|
-
|
277
|
-
.better-ui-alert-warning {
|
278
|
-
color: #856404;
|
279
|
-
background-color: #fff3cd;
|
280
|
-
border-color: #ffeeba;
|
281
|
-
}
|
282
|
-
|
283
|
-
.better-ui-alert-danger {
|
284
|
-
color: #721c24;
|
285
|
-
background-color: #f8d7da;
|
286
|
-
border-color: #f5c6cb;
|
287
|
-
}
|
288
|
-
|
289
|
-
.better-ui-card {
|
290
|
-
position: relative;
|
291
|
-
display: flex;
|
292
|
-
flex-direction: column;
|
293
|
-
min-width: 0;
|
294
|
-
word-wrap: break-word;
|
295
|
-
background-color: #fff;
|
296
|
-
background-clip: border-box;
|
297
|
-
border: 1px solid rgba(0, 0, 0, 0.125);
|
298
|
-
border-radius: 0.25rem;
|
299
|
-
margin-bottom: 1rem;
|
300
|
-
}
|
301
|
-
|
302
|
-
.better-ui-card-header {
|
303
|
-
padding: 0.75rem 1.25rem;
|
304
|
-
margin-bottom: 0;
|
305
|
-
background-color: rgba(0, 0, 0, 0.03);
|
306
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.125);
|
307
|
-
}
|
308
|
-
|
309
|
-
.better-ui-card-title {
|
310
|
-
margin: 0;
|
311
|
-
font-size: 1.25rem;
|
312
|
-
}
|
313
|
-
|
314
|
-
.better-ui-card-body {
|
315
|
-
flex: 1 1 auto;
|
316
|
-
padding: 1.25rem;
|
317
|
-
}
|
318
|
-
|
319
|
-
.better-ui-card-footer {
|
320
|
-
padding: 0.75rem 1.25rem;
|
321
|
-
background-color: rgba(0, 0, 0, 0.03);
|
322
|
-
border-top: 1px solid rgba(0, 0, 0, 0.125);
|
323
|
-
}
|
324
|
-
|
325
|
-
.better-ui-tabs {
|
326
|
-
margin-bottom: 1rem;
|
327
|
-
}
|
328
|
-
|
329
|
-
.better-ui-tab-list {
|
330
|
-
display: flex;
|
331
|
-
flex-wrap: wrap;
|
332
|
-
border-bottom: 1px solid #dee2e6;
|
333
|
-
margin-bottom: 0;
|
334
|
-
list-style: none;
|
335
|
-
}
|
336
|
-
|
337
|
-
.better-ui-tab-item {
|
338
|
-
display: block;
|
339
|
-
padding: 0.5rem 1rem;
|
340
|
-
border: 1px solid transparent;
|
341
|
-
border-top-left-radius: 0.25rem;
|
342
|
-
border-top-right-radius: 0.25rem;
|
343
|
-
cursor: pointer;
|
344
|
-
background: none;
|
345
|
-
margin-bottom: -1px;
|
346
|
-
}
|
347
|
-
|
348
|
-
.better-ui-tab-item:hover {
|
349
|
-
border-color: #e9ecef #e9ecef #dee2e6;
|
350
|
-
}
|
351
|
-
|
352
|
-
.better-ui-tab-active {
|
353
|
-
color: #495057;
|
354
|
-
background-color: #fff;
|
355
|
-
border-color: #dee2e6 #dee2e6 #fff;
|
356
|
-
}
|
357
|
-
|
358
|
-
.better-ui-tab-content {
|
359
|
-
padding: 1rem;
|
360
|
-
border: 1px solid #dee2e6;
|
361
|
-
border-top: 0;
|
362
|
-
border-bottom-right-radius: 0.25rem;
|
363
|
-
border-bottom-left-radius: 0.25rem;
|
364
|
-
}
|
365
|
-
</style>
|
@@ -1,100 +0,0 @@
|
|
1
|
-
<% content_for :title, 'Documentazione' %>
|
2
|
-
|
3
|
-
<div class="better-ui-doc-header">
|
4
|
-
<h1>BetterUI - Componenti UI per Rails</h1>
|
5
|
-
<p>Una libreria di componenti UI riutilizzabili per Rails con documentazione integrata.</p>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<div class="better-ui-doc-section">
|
9
|
-
<h2>Introduzione</h2>
|
10
|
-
<p>
|
11
|
-
BetterUI è una gemma Rails che fornisce componenti UI riutilizzabili pronti all'uso.
|
12
|
-
L'obiettivo principale è fornire un set di componenti UI coerenti e facilmente personalizzabili
|
13
|
-
che possono essere integrati in qualsiasi applicazione Rails.
|
14
|
-
</p>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<div class="better-ui-doc-section">
|
18
|
-
<h2>Installazione</h2>
|
19
|
-
<p>Aggiungi questa riga al tuo Gemfile:</p>
|
20
|
-
<pre><code>gem 'better_ui'</code></pre>
|
21
|
-
|
22
|
-
<p>Quindi esegui:</p>
|
23
|
-
<pre><code>$ bundle install</code></pre>
|
24
|
-
|
25
|
-
<p>O installa tu stesso la gemma:</p>
|
26
|
-
<pre><code>$ gem install better_ui</code></pre>
|
27
|
-
</div>
|
28
|
-
|
29
|
-
<div class="better-ui-doc-section">
|
30
|
-
<h2>Configurazione</h2>
|
31
|
-
<p>Per montare l'engine nel tuo file routes.rb:</p>
|
32
|
-
<pre><code>Rails.application.routes.draw do
|
33
|
-
mount BetterUi::Engine => "/better_ui"
|
34
|
-
end</code></pre>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<div class="better-ui-doc-section">
|
38
|
-
<h2>Componenti disponibili</h2>
|
39
|
-
<div class="better-ui-component-grid">
|
40
|
-
<% @components.each do |component| %>
|
41
|
-
<div class="better-ui-component-card">
|
42
|
-
<h3><%= component[:name] %></h3>
|
43
|
-
<p>Esplora la documentazione e gli esempi per il componente <%= component[:name] %>.</p>
|
44
|
-
<%= link_to "Visualizza dettagli", component[:path], class: "better-ui-component-link" %>
|
45
|
-
</div>
|
46
|
-
<% end %>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<style>
|
51
|
-
.better-ui-doc-header {
|
52
|
-
margin-bottom: 2rem;
|
53
|
-
border-bottom: 1px solid #e0e0e0;
|
54
|
-
padding-bottom: 1rem;
|
55
|
-
}
|
56
|
-
|
57
|
-
.better-ui-doc-section {
|
58
|
-
margin-bottom: 2rem;
|
59
|
-
}
|
60
|
-
|
61
|
-
.better-ui-doc-section h2 {
|
62
|
-
margin-bottom: 1rem;
|
63
|
-
color: #333;
|
64
|
-
}
|
65
|
-
|
66
|
-
pre {
|
67
|
-
background-color: #f5f5f5;
|
68
|
-
padding: 1rem;
|
69
|
-
border-radius: 4px;
|
70
|
-
overflow-x: auto;
|
71
|
-
}
|
72
|
-
|
73
|
-
code {
|
74
|
-
font-family: monospace;
|
75
|
-
}
|
76
|
-
|
77
|
-
.better-ui-component-grid {
|
78
|
-
display: grid;
|
79
|
-
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
80
|
-
gap: 1rem;
|
81
|
-
}
|
82
|
-
|
83
|
-
.better-ui-component-card {
|
84
|
-
border: 1px solid #e0e0e0;
|
85
|
-
border-radius: 4px;
|
86
|
-
padding: 1rem;
|
87
|
-
background-color: #f9f9f9;
|
88
|
-
}
|
89
|
-
|
90
|
-
.better-ui-component-link {
|
91
|
-
display: inline-block;
|
92
|
-
margin-top: 1rem;
|
93
|
-
color: #007bff;
|
94
|
-
text-decoration: none;
|
95
|
-
}
|
96
|
-
|
97
|
-
.better-ui-component-link:hover {
|
98
|
-
text-decoration: underline;
|
99
|
-
}
|
100
|
-
</style>
|
@@ -1,60 +0,0 @@
|
|
1
|
-
<div class="better-ui-doc-content">
|
2
|
-
<%= better_ui_markdown(@content) %>
|
3
|
-
</div>
|
4
|
-
|
5
|
-
<style>
|
6
|
-
.better-ui-doc-content {
|
7
|
-
max-width: 100%;
|
8
|
-
}
|
9
|
-
|
10
|
-
.better-ui-doc-content h1 {
|
11
|
-
margin-bottom: 1.5rem;
|
12
|
-
padding-bottom: 0.5rem;
|
13
|
-
border-bottom: 1px solid #e0e0e0;
|
14
|
-
}
|
15
|
-
|
16
|
-
.better-ui-doc-content h2 {
|
17
|
-
margin-top: 2rem;
|
18
|
-
margin-bottom: 1rem;
|
19
|
-
padding-bottom: 0.5rem;
|
20
|
-
border-bottom: 1px solid #f0f0f0;
|
21
|
-
}
|
22
|
-
|
23
|
-
.better-ui-doc-content pre {
|
24
|
-
background-color: #f5f5f5;
|
25
|
-
padding: 1rem;
|
26
|
-
border-radius: 4px;
|
27
|
-
overflow-x: auto;
|
28
|
-
margin: 1rem 0;
|
29
|
-
}
|
30
|
-
|
31
|
-
.better-ui-doc-content code {
|
32
|
-
font-family: monospace;
|
33
|
-
}
|
34
|
-
|
35
|
-
.better-ui-doc-content ul, .better-ui-doc-content ol {
|
36
|
-
margin-left: 1.5rem;
|
37
|
-
margin-bottom: 1rem;
|
38
|
-
}
|
39
|
-
|
40
|
-
.better-ui-doc-content p {
|
41
|
-
margin-bottom: 1rem;
|
42
|
-
line-height: 1.6;
|
43
|
-
}
|
44
|
-
|
45
|
-
.better-ui-doc-content a {
|
46
|
-
color: #007bff;
|
47
|
-
text-decoration: none;
|
48
|
-
}
|
49
|
-
|
50
|
-
.better-ui-doc-content a:hover {
|
51
|
-
text-decoration: underline;
|
52
|
-
}
|
53
|
-
|
54
|
-
.better-ui-doc-content blockquote {
|
55
|
-
border-left: 4px solid #e0e0e0;
|
56
|
-
padding-left: 1rem;
|
57
|
-
margin-left: 0;
|
58
|
-
color: #666;
|
59
|
-
}
|
60
|
-
</style>
|