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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +65 -1
  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 +196 -0
  11. data/app/components/better_ui/application/header_component.html.erb +88 -0
  12. data/app/components/better_ui/application/header_component.rb +188 -0
  13. data/app/components/better_ui/application/navbar_component.html.erb +294 -0
  14. data/app/components/better_ui/application/navbar_component.rb +249 -0
  15. data/app/components/better_ui/application/sidebar_component.html.erb +207 -0
  16. data/app/components/better_ui/application/sidebar_component.rb +318 -0
  17. data/app/components/better_ui/application/toast_component.html.erb +35 -0
  18. data/app/components/better_ui/application/toast_component.rb +188 -0
  19. data/app/components/better_ui/general/breadcrumb_component.html.erb +39 -0
  20. data/app/components/better_ui/general/breadcrumb_component.rb +132 -0
  21. data/app/components/better_ui/general/button_component.html.erb +34 -0
  22. data/app/components/better_ui/general/button_component.rb +193 -0
  23. data/app/components/better_ui/general/heading_component.html.erb +25 -0
  24. data/app/components/better_ui/general/heading_component.rb +142 -0
  25. data/app/components/better_ui/general/icon_component.html.erb +2 -0
  26. data/app/components/better_ui/general/icon_component.rb +101 -0
  27. data/app/components/better_ui/general/panel_component.html.erb +27 -0
  28. data/app/components/better_ui/general/panel_component.rb +97 -0
  29. data/app/components/better_ui/general/table_component.html.erb +37 -0
  30. data/app/components/better_ui/general/table_component.rb +141 -0
  31. data/app/components/better_ui/theme_helper.rb +169 -0
  32. data/app/controllers/better_ui/application_controller.rb +1 -0
  33. data/app/controllers/better_ui/docs_controller.rb +18 -25
  34. data/app/helpers/better_ui_application_helper.rb +99 -0
  35. data/app/views/layouts/component_preview.html.erb +32 -0
  36. data/config/initializers/lookbook.rb +23 -0
  37. data/config/routes.rb +6 -1
  38. data/lib/better_ui/engine.rb +24 -1
  39. data/lib/better_ui/version.rb +1 -1
  40. metadata +103 -7
  41. data/app/helpers/better_ui/application_helper.rb +0 -183
  42. data/app/views/better_ui/docs/component.html.erb +0 -365
  43. data/app/views/better_ui/docs/index.html.erb +0 -100
  44. data/app/views/better_ui/docs/show.html.erb +0 -60
  45. data/app/views/layouts/better_ui/application.html.erb +0 -135
@@ -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>