better_ui 0.1.0 → 0.5.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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +199 -75
  3. data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +138 -0
  4. data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +211 -0
  5. data/app/assets/javascripts/better_ui/controllers/toast_controller.js +161 -0
  6. data/app/assets/javascripts/better_ui/index.js +159 -0
  7. data/app/assets/javascripts/better_ui/toast_manager.js +77 -0
  8. data/app/assets/stylesheets/better_ui/application.css +25 -351
  9. data/app/components/better_ui/application/alert_component.html.erb +27 -0
  10. data/app/components/better_ui/application/alert_component.rb +202 -0
  11. data/app/components/better_ui/application/card_component.html.erb +24 -0
  12. data/app/components/better_ui/application/card_component.rb +53 -0
  13. data/app/components/better_ui/application/card_container_component.html.erb +8 -0
  14. data/app/components/better_ui/application/card_container_component.rb +14 -0
  15. data/app/components/better_ui/application/header_component.html.erb +88 -0
  16. data/app/components/better_ui/application/header_component.rb +188 -0
  17. data/app/components/better_ui/application/navbar_component.html.erb +294 -0
  18. data/app/components/better_ui/application/navbar_component.rb +249 -0
  19. data/app/components/better_ui/application/sidebar_component.html.erb +207 -0
  20. data/app/components/better_ui/application/sidebar_component.rb +318 -0
  21. data/app/components/better_ui/application/toast_component.html.erb +35 -0
  22. data/app/components/better_ui/application/toast_component.rb +223 -0
  23. data/app/components/better_ui/general/avatar_component.html.erb +19 -0
  24. data/app/components/better_ui/general/avatar_component.rb +171 -0
  25. data/app/components/better_ui/general/badge_component.html.erb +19 -0
  26. data/app/components/better_ui/general/badge_component.rb +123 -0
  27. data/app/components/better_ui/general/breadcrumb_component.html.erb +15 -0
  28. data/app/components/better_ui/general/breadcrumb_component.rb +130 -0
  29. data/app/components/better_ui/general/button_component.html.erb +34 -0
  30. data/app/components/better_ui/general/button_component.rb +162 -0
  31. data/app/components/better_ui/general/heading_component.html.erb +25 -0
  32. data/app/components/better_ui/general/heading_component.rb +148 -0
  33. data/app/components/better_ui/general/icon_component.html.erb +2 -0
  34. data/app/components/better_ui/general/icon_component.rb +100 -0
  35. data/app/components/better_ui/general/link_component.html.erb +17 -0
  36. data/app/components/better_ui/general/link_component.rb +132 -0
  37. data/app/components/better_ui/general/panel_component.html.erb +27 -0
  38. data/app/components/better_ui/general/panel_component.rb +103 -0
  39. data/app/components/better_ui/general/spinner_component.html.erb +15 -0
  40. data/app/components/better_ui/general/spinner_component.rb +79 -0
  41. data/app/components/better_ui/general/table_component.html.erb +73 -0
  42. data/app/components/better_ui/general/table_component.rb +167 -0
  43. data/app/components/better_ui/theme_helper.rb +171 -0
  44. data/app/controllers/better_ui/application_controller.rb +1 -0
  45. data/app/controllers/better_ui/docs_controller.rb +18 -25
  46. data/app/views/components/better_ui/general/table/_custom_body_row.html.erb +17 -0
  47. data/app/views/components/better_ui/general/table/_custom_footer_rows.html.erb +17 -0
  48. data/app/views/components/better_ui/general/table/_custom_header_rows.html.erb +12 -0
  49. data/app/views/layouts/component_preview.html.erb +32 -0
  50. data/config/initializers/lookbook.rb +23 -0
  51. data/config/routes.rb +6 -1
  52. data/lib/better_ui/engine.rb +18 -1
  53. data/lib/better_ui/version.rb +1 -1
  54. data/lib/better_ui.rb +4 -0
  55. data/lib/generators/better_ui/stylesheet_generator.rb +96 -0
  56. data/lib/generators/better_ui/templates/README +56 -0
  57. data/lib/generators/better_ui/templates/components/_avatar.scss +151 -0
  58. data/lib/generators/better_ui/templates/components/_badge.scss +142 -0
  59. data/lib/generators/better_ui/templates/components/_breadcrumb.scss +107 -0
  60. data/lib/generators/better_ui/templates/components/_button.scss +106 -0
  61. data/lib/generators/better_ui/templates/components/_card.scss +69 -0
  62. data/lib/generators/better_ui/templates/components/_heading.scss +180 -0
  63. data/lib/generators/better_ui/templates/components/_icon.scss +90 -0
  64. data/lib/generators/better_ui/templates/components/_link.scss +130 -0
  65. data/lib/generators/better_ui/templates/components/_panel.scss +144 -0
  66. data/lib/generators/better_ui/templates/components/_spinner.scss +132 -0
  67. data/lib/generators/better_ui/templates/components/_table.scss +105 -0
  68. data/lib/generators/better_ui/templates/components/_variables.scss +33 -0
  69. data/lib/generators/better_ui/templates/components_stylesheet.scss +66 -0
  70. metadata +135 -10
  71. data/app/helpers/better_ui/application_helper.rb +0 -183
  72. data/app/views/better_ui/docs/component.html.erb +0 -365
  73. data/app/views/better_ui/docs/index.html.erb +0 -100
  74. data/app/views/better_ui/docs/show.html.erb +0 -60
  75. data/app/views/layouts/better_ui/application.html.erb +0 -135
@@ -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>&lt;%= better_ui_button("Primary", type: 'primary') %&gt;
22
- &lt;%= better_ui_button("Secondary", type: 'secondary') %&gt;
23
- &lt;%= better_ui_button("Success", type: 'success') %&gt;
24
- &lt;%= better_ui_button("Danger", type: 'danger') %&gt;</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>&lt;%= better_ui_alert("Questo è un alert informativo", type: 'info') %&gt;
38
- &lt;%= better_ui_alert("Operazione completata con successo", type: 'success') %&gt;
39
- &lt;%= better_ui_alert("Attenzione: questa è un'azione importante", type: 'warning') %&gt;
40
- &lt;%= better_ui_alert("Si è verificato un errore", type: 'danger') %&gt;</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>&lt;%= better_ui_card do %&gt;
56
- &lt;%= better_ui_card_header("Titolo della Card") %&gt;
57
- &lt;%= better_ui_card_body do %&gt;
58
- &lt;p&gt;Questo è il contenuto della card. Puoi inserire qualsiasi elemento HTML qui.&lt;/p&gt;
59
- &lt;% end %&gt;
60
- &lt;% end %&gt;</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>&lt;%= better_ui_card do %&gt;
80
- &lt;%= better_ui_card_header("Titolo della Card") %&gt;
81
- &lt;%= better_ui_card_body do %&gt;
82
- &lt;p&gt;Questo è il contenuto della card. Puoi inserire qualsiasi elemento HTML qui.&lt;/p&gt;
83
- &lt;% end %&gt;
84
- &lt;%= better_ui_card_footer do %&gt;
85
- &lt;%= better_ui_button("Salva", type: 'primary') %&gt;
86
- &lt;%= better_ui_button("Annulla", type: 'secondary') %&gt;
87
- &lt;% end %&gt;
88
- &lt;% end %&gt;</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>&lt;%= better_ui_tabs do %&gt;
119
- &lt;%= better_ui_tab_list do %&gt;
120
- &lt;%= better_ui_tab_item("Tab 1", "#tab1", active: true) %&gt;
121
- &lt;%= better_ui_tab_item("Tab 2", "#tab2") %&gt;
122
- &lt;%= better_ui_tab_item("Tab 3", "#tab3") %&gt;
123
- &lt;% end %&gt;
124
-
125
- &lt;div class="better-ui-tab-panels"&gt;
126
- &lt;%= better_ui_tab_content(id: 'tab1', class: 'active') do %&gt;
127
- &lt;p&gt;Contenuto del Tab 1&lt;/p&gt;
128
- &lt;% end %&gt;
129
-
130
- &lt;%= better_ui_tab_content(id: 'tab2', style: 'display: none;') do %&gt;
131
- &lt;p&gt;Contenuto del Tab 2&lt;/p&gt;
132
- &lt;% end %&gt;
133
-
134
- &lt;%= better_ui_tab_content(id: 'tab3', style: 'display: none;') do %&gt;
135
- &lt;p&gt;Contenuto del Tab 3&lt;/p&gt;
136
- &lt;% end %&gt;
137
- &lt;/div&gt;
138
- &lt;% end %&gt;</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>
@@ -1,135 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>BetterUI - <%= yield(:title) || 'Componenti UI per Rails' %></title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <%= csrf_meta_tags %>
7
- <%= csp_meta_tag %>
8
-
9
- <%= stylesheet_link_tag "better_ui/application" %>
10
-
11
- <style>
12
- body {
13
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
14
- line-height: 1.5;
15
- color: #333;
16
- margin: 0;
17
- padding: 0;
18
- }
19
-
20
- .better-ui-container {
21
- width: 100%;
22
- max-width: 1200px;
23
- margin: 0 auto;
24
- padding: 1rem;
25
- }
26
-
27
- .better-ui-sidebar {
28
- width: 250px;
29
- padding: 1rem;
30
- background-color: #f5f5f5;
31
- border-right: 1px solid #e0e0e0;
32
- position: fixed;
33
- top: 0;
34
- left: 0;
35
- bottom: 0;
36
- overflow-y: auto;
37
- }
38
-
39
- .better-ui-content {
40
- margin-left: 250px;
41
- padding: 2rem;
42
- }
43
-
44
- .better-ui-nav-title {
45
- font-size: 1.25rem;
46
- font-weight: 600;
47
- margin-bottom: 1rem;
48
- }
49
-
50
- .better-ui-nav-list {
51
- list-style: none;
52
- padding: 0;
53
- margin: 0;
54
- }
55
-
56
- .better-ui-nav-item {
57
- margin-bottom: 0.5rem;
58
- }
59
-
60
- .better-ui-nav-link {
61
- color: #333;
62
- text-decoration: none;
63
- padding: 0.5rem;
64
- display: block;
65
- border-radius: 4px;
66
- }
67
-
68
- .better-ui-nav-link:hover {
69
- background-color: #e0e0e0;
70
- }
71
-
72
- .better-ui-nav-link.active {
73
- background-color: #007bff;
74
- color: white;
75
- }
76
- </style>
77
- </head>
78
-
79
- <body>
80
- <div class="better-ui-container">
81
- <div class="better-ui-sidebar">
82
- <div class="better-ui-nav-title">BetterUI</div>
83
- <nav>
84
- <div class="better-ui-nav-section">
85
- <h3>Documentazione</h3>
86
- <ul class="better-ui-nav-list">
87
- <li class="better-ui-nav-item">
88
- <%= link_to "Guida all'installazione", better_ui.docs_page_path('installation'), class: "better-ui-nav-link" %>
89
- </li>
90
- <li class="better-ui-nav-item">
91
- <%= link_to "Personalizzazione", better_ui.docs_page_path('customization'), class: "better-ui-nav-link" %>
92
- </li>
93
- </ul>
94
- </div>
95
-
96
- <div class="better-ui-nav-section">
97
- <h3>Componenti</h3>
98
- <ul class="better-ui-nav-list">
99
- <% if @components %>
100
- <% @components.each do |component| %>
101
- <li class="better-ui-nav-item">
102
- <%= link_to component[:name], component[:path], class: "better-ui-nav-link" %>
103
- </li>
104
- <% end %>
105
- <% else %>
106
- <li class="better-ui-nav-item">
107
- <%= link_to "Button", better_ui.docs_component_path('button'), class: "better-ui-nav-link" %>
108
- </li>
109
- <li class="better-ui-nav-item">
110
- <%= link_to "Alert", better_ui.docs_component_path('alert'), class: "better-ui-nav-link" %>
111
- </li>
112
- <li class="better-ui-nav-item">
113
- <%= link_to "Card", better_ui.docs_component_path('card'), class: "better-ui-nav-link" %>
114
- </li>
115
- <li class="better-ui-nav-item">
116
- <%= link_to "Modal", better_ui.docs_component_path('modal'), class: "better-ui-nav-link" %>
117
- </li>
118
- <li class="better-ui-nav-item">
119
- <%= link_to "Tabs", better_ui.docs_component_path('tabs'), class: "better-ui-nav-link" %>
120
- </li>
121
- <li class="better-ui-nav-item">
122
- <%= link_to "Form Elements", better_ui.docs_component_path('form_elements'), class: "better-ui-nav-link" %>
123
- </li>
124
- <% end %>
125
- </ul>
126
- </div>
127
- </nav>
128
- </div>
129
-
130
- <div class="better-ui-content">
131
- <%= yield %>
132
- </div>
133
- </div>
134
- </body>
135
- </html>