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
@@ -2,105 +2,108 @@
|
|
2
2
|
* Button Component
|
3
3
|
* ============================== */
|
4
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
|
-
|
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
|
-
|
5
|
+
@layer components {
|
6
|
+
// Classe base per il bottone (Block)
|
7
|
+
.bui-button {
|
8
|
+
@apply inline-flex items-center justify-center font-medium
|
9
|
+
transition-colors duration-200 rounded-md
|
10
|
+
focus:outline-none focus:ring-2 focus:ring-offset-2;
|
11
|
+
|
12
|
+
// Elements
|
13
|
+
&__icon {
|
14
|
+
@apply flex-shrink-0;
|
15
|
+
|
16
|
+
&--left {
|
17
|
+
@apply mr-2;
|
18
|
+
}
|
19
|
+
|
20
|
+
&--right {
|
21
|
+
@apply ml-2;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
&__text {
|
26
|
+
@apply flex-grow;
|
27
|
+
}
|
28
|
+
|
29
|
+
// Modifiers (varianti colore)
|
30
|
+
&--default {
|
31
|
+
@apply bg-black text-white hover:bg-gray-900 focus:ring-gray-900;
|
32
|
+
}
|
33
|
+
|
34
|
+
&--white {
|
35
|
+
@apply bg-white text-black hover:bg-gray-100 focus:ring-gray-400;
|
36
|
+
}
|
37
|
+
|
38
|
+
&--red {
|
39
|
+
@apply bg-red-500 text-white hover:bg-red-600 focus:ring-red-500;
|
40
|
+
}
|
41
|
+
|
42
|
+
&--rose {
|
43
|
+
@apply bg-rose-500 text-white hover:bg-rose-600 focus:ring-rose-500;
|
44
|
+
}
|
45
|
+
|
46
|
+
&--orange {
|
47
|
+
@apply bg-orange-500 text-white hover:bg-orange-600 focus:ring-orange-500;
|
48
|
+
}
|
49
|
+
|
50
|
+
&--green {
|
51
|
+
@apply bg-green-500 text-white hover:bg-green-600 focus:ring-green-500;
|
52
|
+
}
|
53
|
+
|
54
|
+
&--blue {
|
55
|
+
@apply bg-blue-500 text-white hover:bg-blue-600 focus:ring-blue-500;
|
56
|
+
}
|
57
|
+
|
58
|
+
&--yellow {
|
59
|
+
@apply bg-yellow-500 text-black hover:bg-yellow-600 focus:ring-yellow-500;
|
60
|
+
}
|
61
|
+
|
62
|
+
&--violet {
|
63
|
+
@apply bg-violet-500 text-white hover:bg-violet-600 focus:ring-violet-500;
|
64
|
+
}
|
65
|
+
|
66
|
+
// Modifiers (dimensioni)
|
67
|
+
&--small {
|
68
|
+
@apply px-2.5 py-1.5 text-xs;
|
69
|
+
}
|
70
|
+
|
71
|
+
&--medium {
|
72
|
+
@apply px-4 py-2 text-sm;
|
73
|
+
}
|
74
|
+
|
75
|
+
&--large {
|
76
|
+
@apply px-6 py-3 text-base;
|
77
|
+
}
|
78
|
+
|
79
|
+
// Modifiers (border radius)
|
80
|
+
&--radius-none {
|
81
|
+
@apply rounded-none;
|
82
|
+
}
|
83
|
+
|
84
|
+
&--radius-small {
|
85
|
+
@apply rounded-md;
|
86
|
+
}
|
87
|
+
|
88
|
+
&--radius-medium {
|
89
|
+
@apply rounded-lg;
|
90
|
+
}
|
91
|
+
|
92
|
+
&--radius-large {
|
93
|
+
@apply rounded-xl;
|
94
|
+
}
|
95
|
+
|
96
|
+
&--radius-full {
|
97
|
+
@apply rounded-full;
|
98
|
+
}
|
99
|
+
|
100
|
+
// Modifiers (stati)
|
101
|
+
&--disabled {
|
102
|
+
@apply opacity-50 cursor-not-allowed;
|
103
|
+
}
|
104
|
+
|
105
|
+
&--full-width {
|
106
|
+
@apply w-full;
|
107
|
+
}
|
108
|
+
}
|
106
109
|
}
|
@@ -1,69 +1,60 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
/* Struttura di base */
|
6
|
-
.bui-card-base {
|
7
|
-
@apply bg-white border shadow-sm overflow-hidden;
|
8
|
-
}
|
9
|
-
|
10
|
-
/* Contenuto */
|
11
|
-
.bui-card-content {
|
12
|
-
@apply p-4;
|
13
|
-
}
|
14
|
-
|
15
|
-
/* Intestazione */
|
16
|
-
.bui-card-header {
|
17
|
-
@apply p-4 border-b;
|
18
|
-
}
|
19
|
-
|
20
|
-
/* Piè di pagina */
|
21
|
-
.bui-card-footer {
|
22
|
-
@apply p-4 border-t;
|
23
|
-
}
|
24
|
-
|
25
|
-
/* Corpo */
|
26
|
-
.bui-card-body {
|
27
|
-
@apply flex flex-col;
|
28
|
-
}
|
29
|
-
|
30
|
-
/* Titolo */
|
31
|
-
.bui-card-title {
|
32
|
-
@apply text-lg font-medium;
|
33
|
-
}
|
34
|
-
|
35
|
-
/* Valore */
|
36
|
-
.bui-card-value {
|
37
|
-
@apply text-2xl font-bold mt-2;
|
38
|
-
}
|
39
|
-
|
40
|
-
/* Valore di riferimento */
|
41
|
-
.bui-card-value-from {
|
42
|
-
@apply text-sm text-gray-500 mt-1;
|
43
|
-
}
|
44
|
-
|
45
|
-
/* Trend */
|
46
|
-
.bui-card-trend {
|
47
|
-
@apply mt-2 inline-flex items-center px-2 py-1 text-xs font-medium rounded;
|
48
|
-
}
|
49
|
-
|
50
|
-
/* Opzioni di border-radius */
|
51
|
-
.bui-card-radius-none {
|
52
|
-
@apply rounded-none;
|
53
|
-
}
|
1
|
+
@layer components {
|
2
|
+
// Classe base per la card (Block)
|
3
|
+
.bui-card {
|
4
|
+
@apply bg-white border shadow-sm overflow-hidden;
|
54
5
|
|
55
|
-
|
56
|
-
|
57
|
-
|
6
|
+
// Elements
|
7
|
+
&__content {
|
8
|
+
@apply p-4;
|
9
|
+
}
|
58
10
|
|
59
|
-
|
60
|
-
|
61
|
-
}
|
11
|
+
&__header {
|
12
|
+
@apply p-4 border-b;
|
13
|
+
}
|
62
14
|
|
63
|
-
|
64
|
-
|
65
|
-
}
|
15
|
+
&__footer {
|
16
|
+
@apply p-4 border-t;
|
17
|
+
}
|
18
|
+
|
19
|
+
&__body {
|
20
|
+
@apply flex flex-col;
|
21
|
+
}
|
22
|
+
|
23
|
+
&__title {
|
24
|
+
@apply text-lg font-medium;
|
25
|
+
}
|
26
|
+
|
27
|
+
&__value {
|
28
|
+
@apply text-2xl font-bold mt-2;
|
29
|
+
|
30
|
+
&--reference {
|
31
|
+
@apply text-sm text-gray-500 mt-1;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
&__trend {
|
36
|
+
@apply mt-2 inline-flex items-center px-2 py-1 text-xs font-medium rounded;
|
37
|
+
}
|
66
38
|
|
67
|
-
|
68
|
-
|
69
|
-
|
39
|
+
// Modifiers (border radius)
|
40
|
+
&--radius-none {
|
41
|
+
@apply rounded-none;
|
42
|
+
}
|
43
|
+
|
44
|
+
&--radius-small {
|
45
|
+
@apply rounded-md;
|
46
|
+
}
|
47
|
+
|
48
|
+
&--radius-medium {
|
49
|
+
@apply rounded-lg;
|
50
|
+
}
|
51
|
+
|
52
|
+
&--radius-large {
|
53
|
+
@apply rounded-xl;
|
54
|
+
}
|
55
|
+
|
56
|
+
&--radius-full {
|
57
|
+
@apply rounded-full;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
@@ -1,180 +1,81 @@
|
|
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
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
}
|
81
|
-
|
82
|
-
.bui-header-blue-subtitle {
|
83
|
-
@apply text-blue-500;
|
84
|
-
}
|
85
|
-
|
86
|
-
.bui-header-blue-divider {
|
87
|
-
@apply border-blue-300;
|
88
|
-
}
|
89
|
-
|
90
|
-
.bui-header-yellow-heading {
|
91
|
-
@apply text-yellow-700;
|
92
|
-
}
|
93
|
-
|
94
|
-
.bui-header-yellow-subtitle {
|
95
|
-
@apply text-yellow-500;
|
96
|
-
}
|
97
|
-
|
98
|
-
.bui-header-yellow-divider {
|
99
|
-
@apply border-yellow-300;
|
100
|
-
}
|
101
|
-
|
102
|
-
.bui-header-violet-heading {
|
103
|
-
@apply text-violet-700;
|
104
|
-
}
|
105
|
-
|
106
|
-
.bui-header-violet-subtitle {
|
107
|
-
@apply text-violet-500;
|
108
|
-
}
|
109
|
-
|
110
|
-
.bui-header-violet-divider {
|
111
|
-
@apply border-violet-300;
|
112
|
-
}
|
113
|
-
|
114
|
-
/* Classi per le dimensioni dell'intestazione */
|
115
|
-
.bui-header-small-heading {
|
116
|
-
@apply text-xl;
|
117
|
-
}
|
118
|
-
|
119
|
-
.bui-header-small-subtitle {
|
120
|
-
@apply text-base;
|
121
|
-
}
|
122
|
-
|
123
|
-
.bui-header-medium-heading {
|
124
|
-
@apply text-2xl;
|
125
|
-
}
|
126
|
-
|
127
|
-
.bui-header-medium-subtitle {
|
128
|
-
@apply text-lg;
|
129
|
-
}
|
130
|
-
|
131
|
-
.bui-header-large-heading {
|
132
|
-
@apply text-3xl;
|
133
|
-
}
|
134
|
-
|
135
|
-
.bui-header-large-subtitle {
|
136
|
-
@apply text-xl;
|
137
|
-
}
|
138
|
-
|
139
|
-
/* Classi per l'allineamento dell'intestazione */
|
140
|
-
.bui-header-left {
|
141
|
-
@apply text-left;
|
142
|
-
}
|
143
|
-
|
144
|
-
.bui-header-center {
|
145
|
-
@apply text-center;
|
146
|
-
}
|
147
|
-
|
148
|
-
.bui-header-right {
|
149
|
-
@apply text-right;
|
150
|
-
}
|
151
|
-
|
152
|
-
/* Stili comuni */
|
153
|
-
.bui-header-heading-base {
|
154
|
-
@apply font-bold;
|
155
|
-
}
|
156
|
-
|
157
|
-
.bui-header-subtitle-base {
|
158
|
-
@apply mt-1;
|
159
|
-
}
|
160
|
-
|
161
|
-
.bui-header-divider-base {
|
162
|
-
@apply border-t mt-2;
|
163
|
-
}
|
164
|
-
|
165
|
-
.bui-header-container-base {
|
166
|
-
@apply mb-4;
|
167
|
-
}
|
168
|
-
|
169
|
-
.bui-header-container-with-divider {
|
170
|
-
@apply mb-4 pb-2;
|
171
|
-
}
|
172
|
-
|
173
|
-
/* Stili per le icone */
|
174
|
-
.bui-header-icon-container {
|
175
|
-
@apply inline-flex items-center;
|
176
|
-
}
|
177
|
-
|
178
|
-
.bui-header-icon-wrapper {
|
179
|
-
@apply mr-2;
|
1
|
+
@layer components {
|
2
|
+
// Classe base per il titolo (Block)
|
3
|
+
.bui-heading {
|
4
|
+
@apply font-bold text-gray-900 leading-tight;
|
5
|
+
|
6
|
+
// Modifiers (dimensioni/livelli)
|
7
|
+
&--1 {
|
8
|
+
@apply text-3xl sm:text-4xl;
|
9
|
+
}
|
10
|
+
|
11
|
+
&--2 {
|
12
|
+
@apply text-2xl sm:text-3xl;
|
13
|
+
}
|
14
|
+
|
15
|
+
&--3 {
|
16
|
+
@apply text-xl sm:text-2xl;
|
17
|
+
}
|
18
|
+
|
19
|
+
&--4 {
|
20
|
+
@apply text-lg sm:text-xl;
|
21
|
+
}
|
22
|
+
|
23
|
+
&--5 {
|
24
|
+
@apply text-base sm:text-lg;
|
25
|
+
}
|
26
|
+
|
27
|
+
&--6 {
|
28
|
+
@apply text-sm sm:text-base;
|
29
|
+
}
|
30
|
+
|
31
|
+
// Modifiers (varianti colore)
|
32
|
+
&--default {
|
33
|
+
@apply text-gray-900;
|
34
|
+
}
|
35
|
+
|
36
|
+
&--white {
|
37
|
+
@apply text-white;
|
38
|
+
}
|
39
|
+
|
40
|
+
&--red {
|
41
|
+
@apply text-red-600;
|
42
|
+
}
|
43
|
+
|
44
|
+
&--rose {
|
45
|
+
@apply text-rose-600;
|
46
|
+
}
|
47
|
+
|
48
|
+
&--orange {
|
49
|
+
@apply text-orange-600;
|
50
|
+
}
|
51
|
+
|
52
|
+
&--green {
|
53
|
+
@apply text-green-600;
|
54
|
+
}
|
55
|
+
|
56
|
+
&--blue {
|
57
|
+
@apply text-blue-600;
|
58
|
+
}
|
59
|
+
|
60
|
+
&--yellow {
|
61
|
+
@apply text-yellow-600;
|
62
|
+
}
|
63
|
+
|
64
|
+
&--violet {
|
65
|
+
@apply text-violet-600;
|
66
|
+
}
|
67
|
+
|
68
|
+
// Modifiers (allineamento)
|
69
|
+
&--left {
|
70
|
+
@apply text-left;
|
71
|
+
}
|
72
|
+
|
73
|
+
&--center {
|
74
|
+
@apply text-center;
|
75
|
+
}
|
76
|
+
|
77
|
+
&--right {
|
78
|
+
@apply text-right;
|
79
|
+
}
|
80
|
+
}
|
180
81
|
}
|