better_ui 0.1.0 → 0.2.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/MIT-LICENSE +1 -1
- data/README.md +225 -119
- data/app/assets/stylesheets/better_ui/application.css +0 -356
- data/app/components/better_ui/application/card/component.html.erb +20 -0
- data/app/components/better_ui/application/card/component.rb +214 -0
- data/app/components/better_ui/application/main/component.html.erb +9 -0
- data/app/components/better_ui/application/main/component.rb +123 -0
- data/app/components/better_ui/application/navbar/component.html.erb +92 -0
- data/app/components/better_ui/application/navbar/component.rb +136 -0
- data/app/components/better_ui/application/sidebar/component.html.erb +190 -0
- data/app/components/better_ui/application/sidebar/component.rb +129 -0
- data/app/components/better_ui/general/alert/component.html.erb +32 -0
- data/app/components/better_ui/general/alert/component.rb +242 -0
- data/app/components/better_ui/general/avatar/component.html.erb +20 -0
- data/app/components/better_ui/general/avatar/component.rb +301 -0
- data/app/components/better_ui/general/badge/component.html.erb +23 -0
- data/app/components/better_ui/general/badge/component.rb +248 -0
- data/app/components/better_ui/general/breadcrumb/component.html.erb +15 -0
- data/app/components/better_ui/general/breadcrumb/component.rb +187 -0
- data/app/components/better_ui/general/button/component.html.erb +34 -0
- data/app/components/better_ui/general/button/component.rb +214 -0
- data/app/components/better_ui/general/divider/component.html.erb +10 -0
- data/app/components/better_ui/general/divider/component.rb +226 -0
- data/app/components/better_ui/general/dropdown/component.html.erb +14 -0
- data/app/components/better_ui/general/dropdown/component.rb +219 -0
- data/app/components/better_ui/general/dropdown/divider_component.html.erb +1 -0
- data/app/components/better_ui/general/dropdown/divider_component.rb +41 -0
- data/app/components/better_ui/general/dropdown/item_component.html.erb +6 -0
- data/app/components/better_ui/general/dropdown/item_component.rb +118 -0
- data/app/components/better_ui/general/field/component.html.erb +27 -0
- data/app/components/better_ui/general/field/component.rb +37 -0
- data/app/components/better_ui/general/heading/component.html.erb +22 -0
- data/app/components/better_ui/general/heading/component.rb +257 -0
- data/app/components/better_ui/general/icon/component.html.erb +7 -0
- data/app/components/better_ui/general/icon/component.rb +239 -0
- data/app/components/better_ui/general/input/checkbox/component.html.erb +5 -0
- data/app/components/better_ui/general/input/checkbox/component.rb +238 -0
- data/app/components/better_ui/general/input/datetime/component.html.erb +5 -0
- data/app/components/better_ui/general/input/datetime/component.rb +223 -0
- data/app/components/better_ui/general/input/radio/component.html.erb +5 -0
- data/app/components/better_ui/general/input/radio/component.rb +230 -0
- data/app/components/better_ui/general/input/select/component.html.erb +16 -0
- data/app/components/better_ui/general/input/select/component.rb +184 -0
- data/app/components/better_ui/general/input/select/select_component.html.erb +5 -0
- data/app/components/better_ui/general/input/select/select_component.rb +37 -0
- data/app/components/better_ui/general/input/text/component.html.erb +5 -0
- data/app/components/better_ui/general/input/text/component.rb +171 -0
- data/app/components/better_ui/general/input/textarea/component.html.erb +5 -0
- data/app/components/better_ui/general/input/textarea/component.rb +166 -0
- data/app/components/better_ui/general/link/component.html.erb +18 -0
- data/app/components/better_ui/general/link/component.rb +258 -0
- data/app/components/better_ui/general/modal/component.html.erb +42 -0
- data/app/components/better_ui/general/modal/component.rb +165 -0
- data/app/components/better_ui/general/pagination/component.html.erb +85 -0
- data/app/components/better_ui/general/pagination/component.rb +216 -0
- data/app/components/better_ui/general/panel/component.html.erb +28 -0
- data/app/components/better_ui/general/panel/component.rb +249 -0
- data/app/components/better_ui/general/progress/component.html.erb +11 -0
- data/app/components/better_ui/general/progress/component.rb +160 -0
- data/app/components/better_ui/general/spinner/component.html.erb +35 -0
- data/app/components/better_ui/general/spinner/component.rb +93 -0
- data/app/components/better_ui/general/table/component.html.erb +5 -0
- data/app/components/better_ui/general/table/component.rb +217 -0
- data/app/components/better_ui/general/table/tbody_component.html.erb +3 -0
- data/app/components/better_ui/general/table/tbody_component.rb +30 -0
- data/app/components/better_ui/general/table/td_component.html.erb +3 -0
- data/app/components/better_ui/general/table/td_component.rb +44 -0
- data/app/components/better_ui/general/table/tfoot_component.html.erb +3 -0
- data/app/components/better_ui/general/table/tfoot_component.rb +28 -0
- data/app/components/better_ui/general/table/th_component.html.erb +6 -0
- data/app/components/better_ui/general/table/th_component.rb +51 -0
- data/app/components/better_ui/general/table/thead_component.html.erb +3 -0
- data/app/components/better_ui/general/table/thead_component.rb +28 -0
- data/app/components/better_ui/general/table/tr_component.html.erb +3 -0
- data/app/components/better_ui/general/table/tr_component.rb +30 -0
- data/app/components/better_ui/general/tabs/component.html.erb +3 -0
- data/app/components/better_ui/general/tabs/component.rb +102 -0
- data/app/components/better_ui/general/tabs/panel_component.html.erb +3 -0
- data/app/components/better_ui/general/tabs/panel_component.rb +37 -0
- data/app/components/better_ui/general/tabs/tab_component.html.erb +13 -0
- data/app/components/better_ui/general/tabs/tab_component.rb +111 -0
- data/app/components/better_ui/general/tag/component.html.erb +3 -0
- data/app/components/better_ui/general/tag/component.rb +104 -0
- data/app/components/better_ui/general/tooltip/component.html.erb +7 -0
- data/app/components/better_ui/general/tooltip/component.rb +239 -0
- data/app/helpers/better_ui/application/components/card/card_helper.rb +96 -0
- data/app/helpers/better_ui/application/components/card.rb +11 -0
- data/app/helpers/better_ui/application/components/main/main_helper.rb +64 -0
- data/app/helpers/better_ui/application/components/navbar/navbar_helper.rb +77 -0
- data/app/helpers/better_ui/application/components/sidebar/sidebar_helper.rb +51 -0
- data/app/helpers/better_ui/application_helper.rb +51 -179
- data/app/helpers/better_ui/general/components/alert/alert_helper.rb +57 -0
- data/app/helpers/better_ui/general/components/avatar/avatar_helper.rb +29 -0
- data/app/helpers/better_ui/general/components/badge/badge_helper.rb +53 -0
- data/app/helpers/better_ui/general/components/breadcrumb/breadcrumb_helper.rb +37 -0
- data/app/helpers/better_ui/general/components/button/button_helper.rb +65 -0
- data/app/helpers/better_ui/general/components/container/container_helper.rb +60 -0
- data/app/helpers/better_ui/general/components/divider/divider_helper.rb +63 -0
- data/app/helpers/better_ui/general/components/dropdown/divider_helper.rb +32 -0
- data/app/helpers/better_ui/general/components/dropdown/dropdown_helper.rb +79 -0
- data/app/helpers/better_ui/general/components/dropdown/item_helper.rb +62 -0
- data/app/helpers/better_ui/general/components/field/field_helper.rb +26 -0
- data/app/helpers/better_ui/general/components/heading/heading_helper.rb +72 -0
- data/app/helpers/better_ui/general/components/icon/icon_helper.rb +16 -0
- data/app/helpers/better_ui/general/components/input/checkbox/checkbox_helper.rb +81 -0
- data/app/helpers/better_ui/general/components/input/datetime/datetime_helper.rb +91 -0
- data/app/helpers/better_ui/general/components/input/radio/radio_helper.rb +79 -0
- data/app/helpers/better_ui/general/components/input/radio_group/radio_group_helper.rb +124 -0
- data/app/helpers/better_ui/general/components/input/select/select_helper.rb +70 -0
- data/app/helpers/better_ui/general/components/input/text/text_helper.rb +138 -0
- data/app/helpers/better_ui/general/components/input/textarea/textarea_helper.rb +73 -0
- data/app/helpers/better_ui/general/components/link/link_helper.rb +89 -0
- data/app/helpers/better_ui/general/components/modal/modal_helper.rb +95 -0
- data/app/helpers/better_ui/general/components/pagination/pagination_helper.rb +82 -0
- data/app/helpers/better_ui/general/components/panel/panel_helper.rb +83 -0
- data/app/helpers/better_ui/general/components/progress/progress_helper.rb +53 -0
- data/app/helpers/better_ui/general/components/spinner/spinner_helper.rb +19 -0
- data/app/helpers/better_ui/general/components/table/table_helper.rb +53 -0
- data/app/helpers/better_ui/general/components/table/tbody_helper.rb +13 -0
- data/app/helpers/better_ui/general/components/table/td_helper.rb +19 -0
- data/app/helpers/better_ui/general/components/table/tfoot_helper.rb +13 -0
- data/app/helpers/better_ui/general/components/table/th_helper.rb +19 -0
- data/app/helpers/better_ui/general/components/table/thead_helper.rb +13 -0
- data/app/helpers/better_ui/general/components/table/tr_helper.rb +13 -0
- data/app/helpers/better_ui/general/components/tabs/panel_helper.rb +62 -0
- data/app/helpers/better_ui/general/components/tabs/tab_helper.rb +55 -0
- data/app/helpers/better_ui/general/components/tabs/tabs_helper.rb +62 -0
- data/app/helpers/better_ui/general/components/tag/tag_helper.rb +26 -0
- data/app/helpers/better_ui/general/components/tooltip/tooltip_helper.rb +60 -0
- data/app/views/layouts/better_ui/application.html.erb +6 -124
- data/config/initializers/lookbook.rb +23 -0
- data/config/routes.rb +0 -8
- data/lib/better_ui/engine.rb +5 -19
- data/lib/better_ui/railtie.rb +20 -0
- data/lib/better_ui/version.rb +1 -1
- data/lib/better_ui.rb +4 -20
- metadata +155 -28
- data/app/controllers/better_ui/docs_controller.rb +0 -41
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b6dbaeb8dede2be21e4bcff93ba5a7793a08f9e84521c2b46bd8e879be6d072
|
4
|
+
data.tar.gz: b9f58c90c95a748e694018c85aff6ceeb23ecee0f155b8cb45d9b64dc78da2e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bba346a1d310e3869a232212c8708bbff5ef18f048d9361acc895efa78709b6de1e78bfee44dc3b30db77daf3cf380093331d1443b90d0bb6c18a7ad5d9e2e3
|
7
|
+
data.tar.gz: be0e614d6d37d86946d7908e8f2ae0ff83a452dcfc7fc1dd29c42560f77a368bab654e556e767e2d06dcf26236281b9f39987221f0bbee451ff7a16d1125cf39
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,195 +1,301 @@
|
|
1
|
-
# BetterUI
|
1
|
+
# BetterUI
|
2
2
|
|
3
|
-
|
4
|
-
[](LICENSE)
|
3
|
+
Una libreria completa di componenti UI per applicazioni Rails costruita con ViewComponent e Tailwind CSS. Include 26 componenti con un sistema di design unificato e documentazione interattiva.
|
5
4
|
|
6
|
-
|
5
|
+
- 🎨 **Componenti Eleganti**: Componenti UI pre-costruiti con styling Tailwind CSS
|
6
|
+
- 📖 **Documentazione Interattiva**: Preview Lookbook integrate per tutti i componenti
|
7
|
+
- 🔧 **Altamente Personalizzabile**: Opzioni di configurazione flessibili per ogni componente
|
8
|
+
- 🚀 **Production Ready**: Componenti testati che seguono le best practices
|
9
|
+
- 📱 **Responsive**: Tutti i componenti sono mobile-first e responsive
|
10
|
+
- ♿ **Accessibile**: Costruiti pensando all'accessibilità
|
7
11
|
|
8
|
-
|
12
|
+
## Panoramica
|
9
13
|
|
10
|
-
|
14
|
+
Better UI è una gem Rails che fornisce una collezione di componenti UI riutilizzabili costruiti con ViewComponent e Tailwind CSS. Include un sistema di design unificato con tematizzazione consistente e gestione completa dei form.
|
11
15
|
|
12
|
-
|
13
|
-
- **Facile integrazione** - Engine Rails montabile che si integra perfettamente con la tua app
|
14
|
-
- **Documentazione integrata** - Visualizza esempi e documentazione direttamente nel browser
|
15
|
-
- **Altamente personalizzabile** - Adatta facilmente lo stile al tuo brand
|
16
|
-
- **Componenti modulari** - Usa solo ciò di cui hai bisogno
|
16
|
+
### Caratteristiche Principali
|
17
17
|
|
18
|
-
|
18
|
+
- **Solo TailwindCSS**: Approccio puro Tailwind senza file CSS/SCSS personalizzati
|
19
|
+
- **26 Componenti**: Libreria completa organizzata per scopo
|
20
|
+
- **Sistema Input Unificato**: Componenti input supportano 14+ tipi (text, email, password, number, date, time, etc.)
|
21
|
+
- **Documentazione Interattiva**: Integrazione Lookbook con preview live
|
22
|
+
- **Sistema Helper**: Helper Rails-friendly con integrazione form builder
|
23
|
+
- **Tematizzazione Consistente**: 9 temi standard (default, white, red, rose, orange, green, blue, yellow, violet)
|
24
|
+
- **Dimensionamento Flessibile**: 3 dimensioni standard (small, medium, large) con 5 opzioni border radius
|
25
|
+
- **Accessibilità**: Componenti progettati seguendo le best practices di accessibilità
|
19
26
|
|
20
|
-
|
21
|
-
|------------|-------------|
|
22
|
-
| **Button** | Pulsanti stilizzati con varianti primary, secondary, success, danger |
|
23
|
-
| **Alert** | Messaggi informativi, successi, avvisi ed errori |
|
24
|
-
| **Card** | Contenitori flessibili con header, body e footer |
|
25
|
-
| **Modal** | Finestre di dialogo modali |
|
26
|
-
| **Tabs** | Navigazione a schede |
|
27
|
-
| **Form Elements** | Campi di input stilizzati (in arrivo) |
|
28
|
-
|
29
|
-
## 🚀 Installazione
|
27
|
+
## Installazione
|
30
28
|
|
31
29
|
Aggiungi questa riga al Gemfile della tua applicazione:
|
32
30
|
|
33
31
|
```ruby
|
34
|
-
gem
|
32
|
+
gem "better_ui"
|
33
|
+
```
|
34
|
+
|
35
|
+
Per lo sviluppo con documentazione Lookbook:
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
gem "better_ui"
|
39
|
+
gem "lookbook", group: :development
|
35
40
|
```
|
36
41
|
|
37
|
-
|
42
|
+
Quindi esegui:
|
38
43
|
|
39
44
|
```bash
|
40
45
|
$ bundle install
|
41
46
|
```
|
42
47
|
|
43
|
-
##
|
48
|
+
## Setup
|
44
49
|
|
45
|
-
###
|
50
|
+
### 1. Mount Engine (Opzionale)
|
46
51
|
|
47
|
-
|
52
|
+
Se vuoi accedere alle route interne di BetterUI, monta l'engine in `config/routes.rb`:
|
48
53
|
|
49
54
|
```ruby
|
50
55
|
Rails.application.routes.draw do
|
51
|
-
mount BetterUi::Engine =>
|
52
|
-
|
53
|
-
# ... altre tue route
|
56
|
+
mount BetterUi::Engine => "/better_ui"
|
57
|
+
# le tue altre route...
|
54
58
|
end
|
55
59
|
```
|
56
60
|
|
57
|
-
###
|
61
|
+
### 2. Setup Lookbook (Raccomandato per Development)
|
62
|
+
|
63
|
+
Per accedere alla documentazione interattiva dei componenti durante lo sviluppo, monta Lookbook in `config/routes.rb`:
|
58
64
|
|
59
|
-
|
65
|
+
```ruby
|
66
|
+
Rails.application.routes.draw do
|
67
|
+
# Monta Lookbook solo in development
|
68
|
+
mount Lookbook::Engine => "/lookbook" if Rails.env.development?
|
60
69
|
|
61
|
-
|
62
|
-
|
63
|
-
*= require better_ui/application
|
64
|
-
*/
|
70
|
+
# le tue altre route...
|
71
|
+
end
|
65
72
|
```
|
66
73
|
|
67
|
-
|
74
|
+
**Fatto!** I componenti BetterUI e le loro preview sono automaticamente disponibili in Lookbook.
|
75
|
+
|
76
|
+
### 3. Includi Tailwind CSS
|
77
|
+
|
78
|
+
Assicurati che la tua applicazione includa Tailwind CSS, dato che i componenti BetterUI si basano sulle classi Tailwind. Se non hai Tailwind CSS installato, segui la [guida ufficiale di installazione Tailwind CSS](https://tailwindcss.com/docs/guides/ruby-on-rails).
|
79
|
+
|
80
|
+
## Utilizzo
|
68
81
|
|
69
|
-
|
82
|
+
I componenti Better UI possono essere utilizzati in due modi: istanziazione diretta o metodi helper.
|
83
|
+
|
84
|
+
### Metodi Helper (Raccomandato)
|
70
85
|
|
71
86
|
```erb
|
72
|
-
<%#
|
73
|
-
<%=
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
87
|
+
<%# Input di testo con validazione %>
|
88
|
+
<%= bui_input_text(
|
89
|
+
name: 'email',
|
90
|
+
value: @user.email,
|
91
|
+
type: :email,
|
92
|
+
theme: :blue,
|
93
|
+
size: :large,
|
94
|
+
required: true
|
95
|
+
) %>
|
96
|
+
|
97
|
+
<%# Button con theme e size %>
|
98
|
+
<%= bui_button(
|
99
|
+
'Invia Form',
|
100
|
+
theme: :green,
|
101
|
+
size: :large,
|
102
|
+
type: :submit
|
103
|
+
) %>
|
104
|
+
|
105
|
+
<%# Card con blocco di contenuto %>
|
106
|
+
<%= bui_card(title: 'Profilo Utente', theme: :white) do %>
|
107
|
+
<p>Contenuto informazioni utente qui</p>
|
108
|
+
<% end %>
|
109
|
+
|
110
|
+
<%# Integrazione con form %>
|
111
|
+
<%= form_with model: @user do |form| %>
|
112
|
+
<%= bui_input_text(name: 'name', form: form, required: true) %>
|
113
|
+
<%= bui_input_text(name: 'email', type: :email, form: form) %>
|
114
|
+
<%= bui_button('Salva', type: :submit, theme: :blue) %>
|
84
115
|
<% end %>
|
85
116
|
```
|
86
117
|
|
87
|
-
|
118
|
+
### Istanziazione Diretta
|
119
|
+
|
120
|
+
```erb
|
121
|
+
<%# Rendering diretto del componente %>
|
122
|
+
<%= render BetterUi::General::Input::Text::Component.new(
|
123
|
+
name: 'username',
|
124
|
+
type: :text,
|
125
|
+
theme: :default,
|
126
|
+
size: :medium
|
127
|
+
) %>
|
128
|
+
|
129
|
+
<%# Componente button %>
|
130
|
+
<%= render BetterUi::General::Button::Component.new(
|
131
|
+
'Cliccami',
|
132
|
+
theme: :blue,
|
133
|
+
size: :large
|
134
|
+
) %>
|
135
|
+
```
|
88
136
|
|
89
|
-
|
137
|
+
### Sistema di Tematizzazione
|
90
138
|
|
91
|
-
|
139
|
+
Tutti i componenti supportano tematizzazione consistente:
|
92
140
|
|
93
|
-
|
141
|
+
- **9 Temi Standard**: default, white, red, rose, orange, green, blue, yellow, violet
|
142
|
+
- **3 Dimensioni Standard**: small, medium, large
|
143
|
+
- **5 Opzioni Border Radius**: none, small, medium, large, full
|
144
|
+
|
145
|
+
### Approccio Styling
|
146
|
+
|
147
|
+
Better UI usa un approccio TailwindCSS puro con costanti per styling manutenibile:
|
94
148
|
|
95
149
|
```ruby
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
150
|
+
# Le costanti del componente definiscono le opzioni di styling
|
151
|
+
BUTTON_THEME_CLASSES = {
|
152
|
+
default: 'bg-gray-100 text-gray-900 hover:bg-gray-200',
|
153
|
+
blue: 'bg-blue-600 text-white hover:bg-blue-700',
|
154
|
+
green: 'bg-green-600 text-white hover:bg-green-700'
|
155
|
+
}.freeze
|
156
|
+
|
157
|
+
BUTTON_SIZE_CLASSES = {
|
158
|
+
small: 'px-3 py-1.5 text-sm',
|
159
|
+
medium: 'px-4 py-2 text-base',
|
160
|
+
large: 'px-6 py-3 text-lg'
|
161
|
+
}.freeze
|
105
162
|
```
|
106
163
|
|
107
|
-
|
164
|
+
## Componenti Disponibili
|
108
165
|
|
109
|
-
|
166
|
+
Better UI include 26 componenti organizzati in tre categorie:
|
110
167
|
|
111
|
-
|
112
|
-
.better-ui-button-primary {
|
113
|
-
background-color: #8b5cf6; /* Viola personalizzato */
|
114
|
-
border-color: #8b5cf6;
|
115
|
-
}
|
116
|
-
```
|
168
|
+
### Componenti Application (4)
|
117
169
|
|
118
|
-
|
170
|
+
Componenti di layout e navigazione per interfacce applicative:
|
119
171
|
|
120
|
-
|
172
|
+
- **Card**: Container di contenuto con supporto header e azioni
|
173
|
+
- **Main**: Area contenuto principale dell'applicazione con layout responsive
|
174
|
+
- **Navbar**: Barra di navigazione superiore con supporto contenuto flessibile
|
175
|
+
- **Sidebar**: Navigazione laterale collassabile
|
121
176
|
|
122
|
-
###
|
177
|
+
### Componenti General (22)
|
123
178
|
|
124
|
-
|
125
|
-
# Clona il repository
|
126
|
-
git clone https://github.com/alessiobussolari/better_ui.git
|
127
|
-
cd better_ui
|
179
|
+
Elementi UI core per costruire interfacce:
|
128
180
|
|
129
|
-
|
130
|
-
bin/setup
|
131
|
-
```
|
181
|
+
**Display & Feedback**
|
132
182
|
|
133
|
-
|
183
|
+
- **Alert**: Messaggi di notifica con temi multipli e opzioni dismissible
|
184
|
+
- **Avatar**: Immagini profilo utente con supporto fallback
|
185
|
+
- **Badge**: Indicatori di stato e etichette
|
186
|
+
- **Progress**: Barre di progresso e indicatori di caricamento
|
187
|
+
- **Spinner**: Animazioni di caricamento
|
188
|
+
- **Tooltip**: Overlay di aiuto contestuale e informazioni
|
134
189
|
|
135
|
-
|
190
|
+
**Navigazione & Struttura**
|
136
191
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
192
|
+
- **Breadcrumb**: Indicatori di percorso di navigazione
|
193
|
+
- **Divider**: Separatori di contenuto visivi
|
194
|
+
- **Heading**: Intestazioni con tipografia consistente
|
195
|
+
- **Icon**: Sistema icone SVG con libreria estesa
|
196
|
+
- **Link**: Elementi anchor potenziati con supporto theme
|
197
|
+
- **Panel**: Sezioni di contenuto organizzate
|
198
|
+
- **Table**: Tabelle dati con sorting e funzionalità responsive
|
199
|
+
- **Tag**: Elementi di categorizzazione ed etichettatura
|
141
200
|
|
142
|
-
|
143
|
-
|
144
|
-
|
201
|
+
**Form & Input**
|
202
|
+
|
203
|
+
- **Button**: Button azione con varianti multiple e stati
|
204
|
+
- **Field**: Wrapper campo form con supporto label e validazione
|
205
|
+
- **Input**: Sistema input unificato che supporta 14+ tipi:
|
206
|
+
- **Text**: text, email, password, search, url, tel
|
207
|
+
- **Number**: number, range
|
208
|
+
- **Date/Time**: date, datetime-local, time, month, week
|
209
|
+
- **File**: upload file
|
210
|
+
- **Color**: color picker
|
211
|
+
- **Checkbox**: Opzioni multi-selezione
|
212
|
+
- **Radio**: Opzioni selezione singola
|
213
|
+
- **Select**: Selezioni dropdown
|
214
|
+
- **Textarea**: Input testo multi-riga
|
215
|
+
|
216
|
+
### Componenti Form (0)
|
217
|
+
|
218
|
+
Riservati per futuri componenti form specializzati e widget form complessi.
|
219
|
+
|
220
|
+
## Personalizzazione e Styling
|
221
|
+
|
222
|
+
I componenti BetterUI usano classi Tailwind CSS. Puoi:
|
145
223
|
|
146
|
-
|
224
|
+
1. **Sovrascrivere classi**: Passa classi personalizzate tramite il parametro `classes`
|
225
|
+
2. **Estendere componenti**: Crea i tuoi componenti che ereditano da BetterUI
|
226
|
+
3. **Personalizzazione theme**: Modifica la configurazione Tailwind per tematizzazione consistente
|
147
227
|
|
148
|
-
|
228
|
+
```erb
|
229
|
+
<!-- Aggiungi classi personalizzate -->
|
230
|
+
<%= render BetterUi::General::Button::Component.new(
|
231
|
+
label: "Button Personalizzato",
|
232
|
+
classes: "my-custom-class hover:scale-105"
|
233
|
+
) %>
|
234
|
+
```
|
235
|
+
|
236
|
+
Better UI è progettato per essere altamente personalizzabile mantenendo consistenza:
|
149
237
|
|
150
|
-
1. **
|
151
|
-
2. **
|
152
|
-
3. **
|
153
|
-
4. **
|
154
|
-
5. **Testa**: Verifica nell'app dummy che tutto funzioni correttamente
|
155
|
-
6. **Esegui i test**: `rake test`
|
238
|
+
1. **Personalizzazione Theme**: Modifica le costanti dei componenti per cambiare lo styling di default
|
239
|
+
2. **Configurazione Componenti**: Configura opzioni di default in `config/initializers/better_ui.rb`
|
240
|
+
3. **Integrazione TailwindCSS**: Tutto lo styling usa classi TailwindCSS per massima flessibilità
|
241
|
+
4. **Estensioni Componenti**: Estendi componenti esistenti o crea i tuoi seguendo i pattern stabiliti
|
156
242
|
|
157
|
-
|
243
|
+
## Testing
|
158
244
|
|
159
|
-
|
245
|
+
I componenti Better UI sono testati completamente. Puoi eseguire la test suite con:
|
160
246
|
|
161
247
|
```bash
|
162
|
-
|
248
|
+
bin/rails test
|
163
249
|
```
|
164
250
|
|
165
|
-
|
251
|
+
## Supporto Browser
|
252
|
+
|
253
|
+
I componenti BetterUI supportano tutti i browser moderni che supportano:
|
254
|
+
|
255
|
+
- CSS Grid e Flexbox
|
256
|
+
- Funzionalità JavaScript ES6+
|
257
|
+
- Tailwind CSS
|
258
|
+
|
259
|
+
## Contributing
|
260
|
+
|
261
|
+
1. Forka il repository
|
262
|
+
2. Crea il tuo branch feature (`git checkout -b feature/componente-fantastico`)
|
263
|
+
3. Aggiungi il tuo componente con test e preview Lookbook
|
264
|
+
4. Committa le tue modifiche (`git commit -am 'Aggiungi componente fantastico'`)
|
265
|
+
5. Pusha al branch (`git push origin feature/componente-fantastico`)
|
266
|
+
6. Crea una Pull Request
|
267
|
+
|
268
|
+
### Setup Development
|
166
269
|
|
167
270
|
```bash
|
168
|
-
|
271
|
+
git clone https://github.com/alessiobussolari/better_ui.git
|
272
|
+
cd better_ui
|
273
|
+
bundle install
|
274
|
+
cd test/dummy
|
275
|
+
bundle exec rails server
|
169
276
|
```
|
170
277
|
|
171
|
-
|
278
|
+
Visita `http://localhost:3000/lookbook` per vedere la documentazione dei componenti.
|
172
279
|
|
173
|
-
|
280
|
+
## Roadmap
|
174
281
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
282
|
+
- 🎯 Componenti form avanzati (input complessi, validazioni)
|
283
|
+
- 📊 Componenti chart e visualizzazione dati
|
284
|
+
- 🎭 Componenti animazione e transizione
|
285
|
+
- 🌙 Supporto dark mode
|
286
|
+
- 📱 Componenti specifici mobile
|
287
|
+
- 🔧 Tool di configurazione e generatori
|
181
288
|
|
182
|
-
|
289
|
+
## License
|
183
290
|
|
184
|
-
|
185
|
-
- Scrivi test per le nuove funzionalità
|
186
|
-
- Aggiorna la documentazione
|
187
|
-
- Crea componenti che funzionano senza JavaScript
|
291
|
+
La gem è disponibile come open source sotto i termini della [MIT License](https://opensource.org/licenses/MIT).
|
188
292
|
|
189
|
-
##
|
293
|
+
## Support
|
190
294
|
|
191
|
-
|
295
|
+
- 📖 [Documentazione](https://github.com/alessiobussolari/better_ui)
|
296
|
+
- 🐛 [Issue Tracker](https://github.com/alessiobussolari/better_ui/issues)
|
297
|
+
- 💬 [Discussioni](https://github.com/alessiobussolari/better_ui/discussions)
|
192
298
|
|
193
299
|
---
|
194
300
|
|
195
|
-
|
301
|
+
Costruito con ❤️ da [PanDev](https://github.com/alessiobussolari)
|