better_ui 0.5.0 → 0.5.1
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 +137 -245
- data/app/assets/stylesheets/better_ui/_base.scss +9 -0
- data/app/assets/stylesheets/better_ui/_components.scss +2 -0
- data/app/assets/stylesheets/better_ui/_utilities.scss +14 -0
- data/app/assets/stylesheets/better_ui/application.css +3 -1
- data/app/assets/stylesheets/better_ui/components/_avatar.scss +200 -0
- data/app/assets/stylesheets/better_ui/components/_badge.scss +154 -0
- data/app/assets/stylesheets/better_ui/components/_breadcrumb.scss +106 -0
- data/app/assets/stylesheets/better_ui/components/_button.scss +105 -0
- data/app/assets/stylesheets/better_ui/components/_card.scss +60 -0
- data/app/assets/stylesheets/better_ui/components/_heading.scss +81 -0
- data/app/assets/stylesheets/better_ui/components/_icon.scss +134 -0
- data/app/assets/stylesheets/better_ui/components/_index.scss +17 -0
- data/app/assets/stylesheets/better_ui/components/_link.scss +100 -0
- data/app/assets/stylesheets/better_ui/components/_panel.scss +104 -0
- data/app/assets/stylesheets/better_ui/components/_spinner.scss +129 -0
- data/app/assets/stylesheets/better_ui/components/_table.scss +156 -0
- data/app/assets/stylesheets/better_ui/components/_variables.scss +1 -0
- data/app/assets/stylesheets/better_ui.scss +4 -0
- data/app/components/better_ui/general/avatar_component.html.erb +2 -2
- data/app/components/better_ui/general/avatar_component.rb +29 -29
- data/app/components/better_ui/general/badge_component.html.erb +3 -3
- data/app/components/better_ui/general/badge_component.rb +32 -20
- data/app/components/better_ui/general/breadcrumb_component.html.erb +2 -2
- data/app/components/better_ui/general/breadcrumb_component.rb +23 -23
- data/app/components/better_ui/general/button_component.html.erb +6 -6
- data/app/components/better_ui/general/button_component.rb +20 -22
- data/app/components/better_ui/general/heading_component.html.erb +1 -25
- data/app/components/better_ui/general/heading_component.rb +17 -116
- data/app/components/better_ui/general/icon_component.html.erb +1 -1
- data/app/components/better_ui/general/icon_component.rb +33 -56
- data/app/components/better_ui/general/link_component.html.erb +4 -4
- data/app/components/better_ui/general/link_component.rb +28 -28
- data/app/components/better_ui/general/panel_component.rb +30 -41
- data/app/components/better_ui/general/spinner_component.html.erb +3 -3
- data/app/components/better_ui/general/spinner_component.rb +13 -13
- data/app/components/better_ui/general/table_component.rb +35 -59
- data/app/helpers/better_ui/general/components/avatar_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/badge_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/breadcrumb_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/button_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/heading_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/icon_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/link_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/panel_helper.rb +16 -0
- data/app/helpers/better_ui/general/components/spinner_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/table_helper.rb +17 -0
- data/app/helpers/better_ui/general_helper.rb +15 -0
- data/app/helpers/better_ui_helper.rb +12 -0
- data/config/routes.rb +2 -13
- data/lib/better_ui/engine.rb +67 -11
- data/lib/better_ui/version.rb +1 -1
- data/lib/better_ui.rb +10 -2
- data/lib/generators/better_ui/install_generator.rb +103 -0
- data/lib/generators/better_ui/stylesheet_generator.rb +93 -30
- data/lib/generators/better_ui/templates/README +74 -5
- data/lib/generators/better_ui/templates/components/_avatar.scss +199 -150
- data/lib/generators/better_ui/templates/components/_badge.scss +153 -141
- data/lib/generators/better_ui/templates/components/_breadcrumb.scss +105 -106
- data/lib/generators/better_ui/templates/components/_button.scss +104 -101
- data/lib/generators/better_ui/templates/components/_card.scss +56 -65
- data/lib/generators/better_ui/templates/components/_heading.scss +80 -179
- data/lib/generators/better_ui/templates/components/_icon.scss +133 -89
- data/lib/generators/better_ui/templates/components/_index.scss +17 -0
- data/lib/generators/better_ui/templates/components/_link.scss +99 -129
- data/lib/generators/better_ui/templates/components/_panel.scss +103 -143
- data/lib/generators/better_ui/templates/components/_spinner.scss +127 -130
- data/lib/generators/better_ui/templates/components/_table.scss +156 -105
- data/lib/generators/better_ui/templates/components/_variables.scss +0 -33
- data/lib/generators/better_ui/templates/components_stylesheet.scss +25 -56
- data/lib/generators/better_ui/templates/index.scss +18 -0
- data/lib/generators/better_ui/templates/initializer.rb +41 -0
- metadata +91 -49
- data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +0 -138
- data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +0 -211
- data/app/assets/javascripts/better_ui/controllers/toast_controller.js +0 -161
- data/app/assets/javascripts/better_ui/index.js +0 -159
- data/app/assets/javascripts/better_ui/toast_manager.js +0 -77
- data/app/components/better_ui/theme_helper.rb +0 -171
- data/app/controllers/better_ui/docs_controller.rb +0 -34
@@ -1,3 +1,65 @@
|
|
1
|
+
==========================================================
|
2
|
+
BETTER UI
|
3
|
+
==========================================================
|
4
|
+
|
5
|
+
Fogli di stile per componenti generati con successo!
|
6
|
+
|
7
|
+
STRUTTURA DEI FILE:
|
8
|
+
----------------------------------------------------------
|
9
|
+
I seguenti file sono stati creati:
|
10
|
+
|
11
|
+
1. File principale:
|
12
|
+
* <%= options[:prefix] %>_better_ui_components.scss
|
13
|
+
|
14
|
+
2. File indice:
|
15
|
+
* components/_index.scss (raccoglie tutti gli override usando @forward)
|
16
|
+
|
17
|
+
3. File di override:
|
18
|
+
* components/_variables_overrides.scss
|
19
|
+
* components/_button_overrides.scss
|
20
|
+
* components/_heading_overrides.scss
|
21
|
+
... e altri file di override
|
22
|
+
|
23
|
+
COME UTILIZZARE:
|
24
|
+
----------------------------------------------------------
|
25
|
+
1. Il file principale già utilizza @use per importare tutti i componenti:
|
26
|
+
@use 'better_ui/components' as bui;
|
27
|
+
@use 'components/index' as overrides;
|
28
|
+
|
29
|
+
2. Personalizza i componenti modificando i file *_overrides.scss:
|
30
|
+
Ogni file di override contiene classi vuote corrispondenti
|
31
|
+
alle classi originali, pronte per essere personalizzate.
|
32
|
+
|
33
|
+
3. Se hai bisogno di aggiungere nuovi file SCSS, ricorda di includere
|
34
|
+
il riferimento nel file components/_index.scss usando @forward.
|
35
|
+
|
36
|
+
BEST PRACTICES:
|
37
|
+
----------------------------------------------------------
|
38
|
+
* Segui la metodologia BEM per le tue personalizzazioni
|
39
|
+
* Usa le variabili CSS definite in _variables.scss
|
40
|
+
* Mantieni la coerenza visiva tra i componenti
|
41
|
+
* Aggiungi nuovi modificatori nei file di override
|
42
|
+
|
43
|
+
ESEMPIO DI PERSONALIZZAZIONE:
|
44
|
+
----------------------------------------------------------
|
45
|
+
// In _button_overrides.scss
|
46
|
+
@layer components {
|
47
|
+
.bui-button {
|
48
|
+
// Modifica la classe base
|
49
|
+
@apply transition-all;
|
50
|
+
|
51
|
+
// Modifica uno specifico modificatore
|
52
|
+
&--primary {
|
53
|
+
@apply bg-indigo-600 hover:bg-indigo-700;
|
54
|
+
}
|
55
|
+
|
56
|
+
// Aggiungi un nuovo modificatore
|
57
|
+
&--custom {
|
58
|
+
@apply bg-gradient-to-r from-purple-500 to-pink-500;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
1
63
|
===============================================================================
|
2
64
|
|
3
65
|
Installazione completata!
|
@@ -5,7 +67,7 @@ Installazione completata!
|
|
5
67
|
Il tuo foglio di stile SCSS per la personalizzazione dei componenti di BetterUi
|
6
68
|
è stato creato in:
|
7
69
|
|
8
|
-
|
70
|
+
<%= options[:path] %>/<%= options[:prefix] %>_better_ui_components.scss
|
9
71
|
|
10
72
|
===============================================================================
|
11
73
|
|
@@ -18,7 +80,7 @@ PROSSIMI PASSI:
|
|
18
80
|
|
19
81
|
In app/assets/stylesheets/application.scss:
|
20
82
|
|
21
|
-
@
|
83
|
+
@use '<%= options[:prefix] %>_better_ui_components';
|
22
84
|
|
23
85
|
Oppure in app/assets/stylesheets/application.css:
|
24
86
|
|
@@ -26,12 +88,19 @@ PROSSIMI PASSI:
|
|
26
88
|
*= require <%= options[:prefix] %>_better_ui_components
|
27
89
|
*/
|
28
90
|
|
29
|
-
|
91
|
+
Se hai utilizzato un path personalizzato, assicurati di importare
|
92
|
+
correttamente il file dal percorso specificato.
|
93
|
+
|
94
|
+
3. I file SCSS utilizzano la moderna sintassi @use e @forward di Sass
|
95
|
+
invece della sintassi @import deprecata. Questo ti permette di evitare
|
96
|
+
conflitti di nome e organizzare meglio il tuo codice SCSS.
|
97
|
+
|
98
|
+
4. Personalizza le variabili SCSS e le classi secondo le tue esigenze.
|
30
99
|
Il foglio di stile utilizza le classi di Tailwind CSS tramite la direttiva
|
31
100
|
@apply, consentendoti di sfruttare l'ecosistema Tailwind mantenendo un
|
32
101
|
codice SCSS organizzato e modulare.
|
33
102
|
|
34
|
-
|
103
|
+
5. Nei componenti Ruby, usa le classi con prefisso 'bui-' invece di includere
|
35
104
|
direttamente le classi Tailwind. Ad esempio per i bottoni:
|
36
105
|
|
37
106
|
# Esempio di utilizzo di classi CSS personalizzate
|
@@ -44,7 +113,7 @@ PROSSIMI PASSI:
|
|
44
113
|
Questo approccio centralizza gli stili nel foglio SCSS e rende più facile
|
45
114
|
mantenere e modificare l'aspetto dei componenti.
|
46
115
|
|
47
|
-
|
116
|
+
6. Assicurati che il tuo foglio di stile venga caricato dopo i fogli di stile
|
48
117
|
di BetterUI per sovrascrivere correttamente gli stili predefiniti.
|
49
118
|
|
50
119
|
===============================================================================
|
@@ -1,151 +1,200 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
.bui-
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
.
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
}
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
}
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
}
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
.bui-
|
133
|
-
|
134
|
-
}
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
}
|
148
|
-
|
149
|
-
|
150
|
-
|
1
|
+
@layer components {
|
2
|
+
// Classe base per l'avatar (Block)
|
3
|
+
.bui-avatar {
|
4
|
+
@apply inline-flex items-center justify-center relative;
|
5
|
+
|
6
|
+
// Elements
|
7
|
+
&__image {
|
8
|
+
@apply object-cover;
|
9
|
+
}
|
10
|
+
|
11
|
+
&__placeholder {
|
12
|
+
@apply flex items-center justify-center font-medium text-white uppercase;
|
13
|
+
}
|
14
|
+
|
15
|
+
&__status {
|
16
|
+
@apply absolute bottom-0 right-0 block rounded-full ring-2 ring-white;
|
17
|
+
|
18
|
+
&--online {
|
19
|
+
@apply bg-green-400;
|
20
|
+
}
|
21
|
+
|
22
|
+
&--offline {
|
23
|
+
@apply bg-gray-400;
|
24
|
+
}
|
25
|
+
|
26
|
+
&--busy {
|
27
|
+
@apply bg-red-400;
|
28
|
+
}
|
29
|
+
|
30
|
+
&--away {
|
31
|
+
@apply bg-yellow-400;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
&__presence {
|
36
|
+
@apply absolute block rounded-full ring-2 ring-white;
|
37
|
+
}
|
38
|
+
|
39
|
+
&__badge {
|
40
|
+
@apply absolute -top-1 -right-1 flex items-center justify-center;
|
41
|
+
}
|
42
|
+
|
43
|
+
// Modifiers (dimensioni)
|
44
|
+
&--xs {
|
45
|
+
@apply h-6 w-6;
|
46
|
+
|
47
|
+
.bui-avatar__placeholder {
|
48
|
+
@apply text-xs;
|
49
|
+
}
|
50
|
+
|
51
|
+
.bui-avatar__status {
|
52
|
+
@apply h-1.5 w-1.5;
|
53
|
+
}
|
54
|
+
|
55
|
+
.bui-avatar__badge {
|
56
|
+
@apply h-4 w-4 text-[0.6rem];
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
&--sm {
|
61
|
+
@apply h-8 w-8;
|
62
|
+
|
63
|
+
.bui-avatar__placeholder {
|
64
|
+
@apply text-xs;
|
65
|
+
}
|
66
|
+
|
67
|
+
.bui-avatar__status {
|
68
|
+
@apply h-2 w-2;
|
69
|
+
}
|
70
|
+
|
71
|
+
.bui-avatar__badge {
|
72
|
+
@apply h-5 w-5 text-xs;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
&--md {
|
77
|
+
@apply h-10 w-10;
|
78
|
+
|
79
|
+
.bui-avatar__placeholder {
|
80
|
+
@apply text-sm;
|
81
|
+
}
|
82
|
+
|
83
|
+
.bui-avatar__status {
|
84
|
+
@apply h-2.5 w-2.5;
|
85
|
+
}
|
86
|
+
|
87
|
+
.bui-avatar__badge {
|
88
|
+
@apply h-6 w-6 text-xs;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
&--lg {
|
93
|
+
@apply h-12 w-12;
|
94
|
+
|
95
|
+
.bui-avatar__placeholder {
|
96
|
+
@apply text-base;
|
97
|
+
}
|
98
|
+
|
99
|
+
.bui-avatar__status {
|
100
|
+
@apply h-3 w-3;
|
101
|
+
}
|
102
|
+
|
103
|
+
.bui-avatar__badge {
|
104
|
+
@apply h-7 w-7 text-sm;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
&--xl {
|
109
|
+
@apply h-16 w-16;
|
110
|
+
|
111
|
+
.bui-avatar__placeholder {
|
112
|
+
@apply text-lg;
|
113
|
+
}
|
114
|
+
|
115
|
+
.bui-avatar__status {
|
116
|
+
@apply h-4 w-4;
|
117
|
+
}
|
118
|
+
|
119
|
+
.bui-avatar__badge {
|
120
|
+
@apply h-8 w-8 text-sm;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
// Modifiers (colori placeholders)
|
125
|
+
&--gray {
|
126
|
+
.bui-avatar__placeholder {
|
127
|
+
@apply bg-gray-500;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
&--red {
|
132
|
+
.bui-avatar__placeholder {
|
133
|
+
@apply bg-red-500;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
&--blue {
|
138
|
+
.bui-avatar__placeholder {
|
139
|
+
@apply bg-blue-500;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
&--green {
|
144
|
+
.bui-avatar__placeholder {
|
145
|
+
@apply bg-green-500;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
&--violet {
|
150
|
+
.bui-avatar__placeholder {
|
151
|
+
@apply bg-violet-500;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
&--orange {
|
156
|
+
.bui-avatar__placeholder {
|
157
|
+
@apply bg-orange-500;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
&--yellow {
|
162
|
+
.bui-avatar__placeholder {
|
163
|
+
@apply bg-yellow-500 text-yellow-900;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
|
167
|
+
// Modifiers (forma)
|
168
|
+
&--circle {
|
169
|
+
@apply rounded-full;
|
170
|
+
|
171
|
+
.bui-avatar__image,
|
172
|
+
.bui-avatar__placeholder {
|
173
|
+
@apply rounded-full;
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
&--square {
|
178
|
+
@apply rounded-md;
|
179
|
+
|
180
|
+
.bui-avatar__image,
|
181
|
+
.bui-avatar__placeholder {
|
182
|
+
@apply rounded-md;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
// Modifiers (gruppo)
|
187
|
+
&--group {
|
188
|
+
@apply -ml-2 first:ml-0;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
// Avatar group container
|
193
|
+
.bui-avatar-group {
|
194
|
+
@apply flex;
|
195
|
+
|
196
|
+
.bui-avatar {
|
197
|
+
@apply border-2 border-white;
|
198
|
+
}
|
199
|
+
}
|
151
200
|
}
|