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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +137 -245
  3. data/app/assets/stylesheets/better_ui/_base.scss +9 -0
  4. data/app/assets/stylesheets/better_ui/_components.scss +2 -0
  5. data/app/assets/stylesheets/better_ui/_utilities.scss +14 -0
  6. data/app/assets/stylesheets/better_ui/application.css +3 -1
  7. data/app/assets/stylesheets/better_ui/components/_avatar.scss +200 -0
  8. data/app/assets/stylesheets/better_ui/components/_badge.scss +154 -0
  9. data/app/assets/stylesheets/better_ui/components/_breadcrumb.scss +106 -0
  10. data/app/assets/stylesheets/better_ui/components/_button.scss +105 -0
  11. data/app/assets/stylesheets/better_ui/components/_card.scss +60 -0
  12. data/app/assets/stylesheets/better_ui/components/_heading.scss +81 -0
  13. data/app/assets/stylesheets/better_ui/components/_icon.scss +134 -0
  14. data/app/assets/stylesheets/better_ui/components/_index.scss +17 -0
  15. data/app/assets/stylesheets/better_ui/components/_link.scss +100 -0
  16. data/app/assets/stylesheets/better_ui/components/_panel.scss +104 -0
  17. data/app/assets/stylesheets/better_ui/components/_spinner.scss +129 -0
  18. data/app/assets/stylesheets/better_ui/components/_table.scss +156 -0
  19. data/app/assets/stylesheets/better_ui/components/_variables.scss +1 -0
  20. data/app/assets/stylesheets/better_ui.scss +4 -0
  21. data/app/components/better_ui/general/avatar_component.html.erb +2 -2
  22. data/app/components/better_ui/general/avatar_component.rb +29 -29
  23. data/app/components/better_ui/general/badge_component.html.erb +3 -3
  24. data/app/components/better_ui/general/badge_component.rb +32 -20
  25. data/app/components/better_ui/general/breadcrumb_component.html.erb +2 -2
  26. data/app/components/better_ui/general/breadcrumb_component.rb +23 -23
  27. data/app/components/better_ui/general/button_component.html.erb +6 -6
  28. data/app/components/better_ui/general/button_component.rb +20 -22
  29. data/app/components/better_ui/general/heading_component.html.erb +1 -25
  30. data/app/components/better_ui/general/heading_component.rb +17 -116
  31. data/app/components/better_ui/general/icon_component.html.erb +1 -1
  32. data/app/components/better_ui/general/icon_component.rb +33 -56
  33. data/app/components/better_ui/general/link_component.html.erb +4 -4
  34. data/app/components/better_ui/general/link_component.rb +28 -28
  35. data/app/components/better_ui/general/panel_component.rb +30 -41
  36. data/app/components/better_ui/general/spinner_component.html.erb +3 -3
  37. data/app/components/better_ui/general/spinner_component.rb +13 -13
  38. data/app/components/better_ui/general/table_component.rb +35 -59
  39. data/app/helpers/better_ui/general/components/avatar_helper.rb +17 -0
  40. data/app/helpers/better_ui/general/components/badge_helper.rb +17 -0
  41. data/app/helpers/better_ui/general/components/breadcrumb_helper.rb +17 -0
  42. data/app/helpers/better_ui/general/components/button_helper.rb +17 -0
  43. data/app/helpers/better_ui/general/components/heading_helper.rb +17 -0
  44. data/app/helpers/better_ui/general/components/icon_helper.rb +17 -0
  45. data/app/helpers/better_ui/general/components/link_helper.rb +17 -0
  46. data/app/helpers/better_ui/general/components/panel_helper.rb +16 -0
  47. data/app/helpers/better_ui/general/components/spinner_helper.rb +17 -0
  48. data/app/helpers/better_ui/general/components/table_helper.rb +17 -0
  49. data/app/helpers/better_ui/general_helper.rb +15 -0
  50. data/app/helpers/better_ui_helper.rb +12 -0
  51. data/config/routes.rb +2 -13
  52. data/lib/better_ui/engine.rb +67 -11
  53. data/lib/better_ui/version.rb +1 -1
  54. data/lib/better_ui.rb +10 -2
  55. data/lib/generators/better_ui/install_generator.rb +103 -0
  56. data/lib/generators/better_ui/stylesheet_generator.rb +93 -30
  57. data/lib/generators/better_ui/templates/README +74 -5
  58. data/lib/generators/better_ui/templates/components/_avatar.scss +199 -150
  59. data/lib/generators/better_ui/templates/components/_badge.scss +153 -141
  60. data/lib/generators/better_ui/templates/components/_breadcrumb.scss +105 -106
  61. data/lib/generators/better_ui/templates/components/_button.scss +104 -101
  62. data/lib/generators/better_ui/templates/components/_card.scss +56 -65
  63. data/lib/generators/better_ui/templates/components/_heading.scss +80 -179
  64. data/lib/generators/better_ui/templates/components/_icon.scss +133 -89
  65. data/lib/generators/better_ui/templates/components/_index.scss +17 -0
  66. data/lib/generators/better_ui/templates/components/_link.scss +99 -129
  67. data/lib/generators/better_ui/templates/components/_panel.scss +103 -143
  68. data/lib/generators/better_ui/templates/components/_spinner.scss +127 -130
  69. data/lib/generators/better_ui/templates/components/_table.scss +156 -105
  70. data/lib/generators/better_ui/templates/components/_variables.scss +0 -33
  71. data/lib/generators/better_ui/templates/components_stylesheet.scss +25 -56
  72. data/lib/generators/better_ui/templates/index.scss +18 -0
  73. data/lib/generators/better_ui/templates/initializer.rb +41 -0
  74. metadata +91 -49
  75. data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +0 -138
  76. data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +0 -211
  77. data/app/assets/javascripts/better_ui/controllers/toast_controller.js +0 -161
  78. data/app/assets/javascripts/better_ui/index.js +0 -159
  79. data/app/assets/javascripts/better_ui/toast_manager.js +0 -77
  80. data/app/components/better_ui/theme_helper.rb +0 -171
  81. data/app/controllers/better_ui/docs_controller.rb +0 -34
@@ -1,144 +1,104 @@
1
- /* ==============================
2
- * Panel Component
3
- * ============================== */
4
-
5
- /* Struttura di base */
6
- .bui-panel-base {
7
- @apply border shadow-sm;
8
- }
9
-
10
- /* Intestazione */
11
- .bui-panel-header {
12
- @apply px-4 py-3 border-b;
13
- }
14
-
15
- /* Corpo */
16
- .bui-panel-body {
17
- @apply p-4;
18
- }
19
-
20
- .bui-panel-body-content {
21
- @apply overflow-x-auto break-words;
22
- }
23
-
24
- /* Piè di pagina */
25
- .bui-panel-footer {
26
- @apply px-4 py-3 border-t;
27
- }
28
-
29
- /* Titolo */
30
- .bui-panel-title {
31
- @apply text-lg font-medium;
32
- }
33
-
34
- /* Opzioni di padding */
35
- .bui-panel-padding-none {
36
- @apply p-0;
37
- }
38
-
39
- .bui-panel-padding-small {
40
- @apply p-2;
41
- }
42
-
43
- .bui-panel-padding-medium {
44
- @apply p-4;
45
- }
46
-
47
- .bui-panel-padding-large {
48
- @apply p-6;
49
- }
50
-
51
- /* Opzioni di border-radius */
52
- .bui-panel-radius-none {
53
- @apply rounded-none;
54
- }
55
-
56
- .bui-panel-radius-small {
57
- @apply rounded-md;
58
- }
59
-
60
- .bui-panel-radius-medium {
61
- @apply rounded-lg;
62
- }
63
-
64
- .bui-panel-radius-large {
65
- @apply rounded-xl;
66
- }
67
-
68
- .bui-panel-radius-full {
69
- @apply rounded-full;
70
- }
71
-
72
- /* Temi di colore per header */
73
- .bui-panel-default-header {
74
- @apply bg-black text-white;
75
- }
76
-
77
- .bui-panel-white-header {
78
- @apply bg-white text-black;
79
- }
80
-
81
- .bui-panel-red-header {
82
- @apply bg-red-500 text-white;
83
- }
84
-
85
- .bui-panel-rose-header {
86
- @apply bg-rose-500 text-white;
87
- }
88
-
89
- .bui-panel-orange-header {
90
- @apply bg-orange-500 text-white;
91
- }
92
-
93
- .bui-panel-green-header {
94
- @apply bg-green-500 text-white;
95
- }
96
-
97
- .bui-panel-blue-header {
98
- @apply bg-blue-500 text-white;
99
- }
100
-
101
- .bui-panel-yellow-header {
102
- @apply bg-yellow-500 text-black;
103
- }
104
-
105
- .bui-panel-violet-header {
106
- @apply bg-violet-500 text-white;
107
- }
108
-
109
- /* Temi di colore per footer */
110
- .bui-panel-default-footer {
111
- @apply bg-black text-white;
112
- }
113
-
114
- .bui-panel-white-footer {
115
- @apply bg-white text-black;
116
- }
117
-
118
- .bui-panel-red-footer {
119
- @apply bg-red-500 text-white;
120
- }
121
-
122
- .bui-panel-rose-footer {
123
- @apply bg-rose-500 text-white;
124
- }
125
-
126
- .bui-panel-orange-footer {
127
- @apply bg-orange-500 text-white;
128
- }
129
-
130
- .bui-panel-green-footer {
131
- @apply bg-green-500 text-white;
132
- }
133
-
134
- .bui-panel-blue-footer {
135
- @apply bg-blue-500 text-white;
136
- }
137
-
138
- .bui-panel-yellow-footer {
139
- @apply bg-yellow-500 text-black;
140
- }
141
-
142
- .bui-panel-violet-footer {
143
- @apply bg-violet-500 text-white;
1
+ @layer components {
2
+ // Classe base per il pannello (Block)
3
+ .bui-panel {
4
+ @apply border shadow-sm;
5
+
6
+ // Elements
7
+ &__header {
8
+ @apply px-4 py-3 border-b;
9
+ }
10
+
11
+ &__body {
12
+ @apply p-4;
13
+ }
14
+
15
+ &__footer {
16
+ @apply px-4 py-3 border-t;
17
+ }
18
+
19
+ &__title {
20
+ @apply text-lg font-medium;
21
+ }
22
+
23
+ // Modifiers (varianti colore)
24
+ &--default {
25
+ @apply bg-black text-white border-gray-900;
26
+
27
+ .bui-panel__header {
28
+ @apply bg-gray-900;
29
+ }
30
+
31
+ .bui-panel__footer {
32
+ @apply bg-gray-900;
33
+ }
34
+ }
35
+
36
+ &--white {
37
+ @apply bg-white text-black border-gray-200;
38
+
39
+ .bui-panel__header {
40
+ @apply bg-gray-50;
41
+ }
42
+
43
+ .bui-panel__footer {
44
+ @apply bg-gray-50;
45
+ }
46
+ }
47
+
48
+ &--red {
49
+ @apply bg-red-50 text-red-900 border-red-200;
50
+
51
+ .bui-panel__header {
52
+ @apply bg-red-100 text-red-800;
53
+ }
54
+
55
+ .bui-panel__footer {
56
+ @apply bg-red-100;
57
+ }
58
+ }
59
+
60
+ // ... altre varianti di colore ...
61
+
62
+ // Modifiers (varianti di padding)
63
+ &--padding-none {
64
+ .bui-panel__body {
65
+ @apply p-0;
66
+ }
67
+ }
68
+
69
+ &--padding-small {
70
+ .bui-panel__body {
71
+ @apply p-2;
72
+ }
73
+ }
74
+
75
+ &--padding-medium {
76
+ .bui-panel__body {
77
+ @apply p-4;
78
+ }
79
+ }
80
+
81
+ &--padding-large {
82
+ .bui-panel__body {
83
+ @apply p-6;
84
+ }
85
+ }
86
+
87
+ // Modifiers (border radius)
88
+ &--radius-none {
89
+ @apply rounded-none;
90
+ }
91
+
92
+ &--radius-small {
93
+ @apply rounded-md;
94
+ }
95
+
96
+ &--radius-medium {
97
+ @apply rounded-lg;
98
+ }
99
+
100
+ &--radius-large {
101
+ @apply rounded-xl;
102
+ }
103
+ }
144
104
  }
@@ -1,132 +1,129 @@
1
- /* ==============================
2
- * Spinner Component
3
- * ============================== */
4
-
5
- /* Stile base */
6
- .bui-spinner {
7
- @apply inline-flex flex-col items-center justify-center;
8
- }
9
-
10
- /* Animazione dello spinner */
11
- .bui-spinner-animation {
12
- @apply inline-block rounded-full animate-spin;
13
- border-top-color: transparent;
14
- }
15
-
16
- /* Base per il contenuto */
17
- .bui-spinner-label {
18
- @apply mt-2 text-center;
19
- }
20
-
21
- .bui-spinner-content {
22
- @apply mt-4;
23
- }
24
-
25
- /* Modalità fullscreen */
26
- .bui-spinner-fullscreen {
27
- @apply fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50;
28
- }
29
-
30
- /* Varianti di dimensione */
31
- .bui-spinner-small .bui-spinner-animation {
32
- @apply w-5 h-5 border-2;
33
- }
34
-
35
- .bui-spinner-medium .bui-spinner-animation {
36
- @apply w-8 h-8 border-3;
37
- }
38
-
39
- .bui-spinner-large .bui-spinner-animation {
40
- @apply w-12 h-12 border-4;
41
- }
42
-
43
- /* Varianti di colore */
44
- .bui-spinner-default {
45
- .bui-spinner-animation {
46
- @apply border-gray-200 border-t-gray-800;
47
- }
48
-
49
- .bui-spinner-label {
50
- @apply text-gray-800;
51
- }
52
- }
53
-
54
- .bui-spinner-white {
55
- .bui-spinner-animation {
56
- @apply border-gray-100 border-t-white;
57
- }
58
-
59
- .bui-spinner-label {
60
- @apply text-white;
61
- }
62
- }
63
-
64
- .bui-spinner-red {
65
- .bui-spinner-animation {
66
- @apply border-red-100 border-t-red-600;
67
- }
68
-
69
- .bui-spinner-label {
70
- @apply text-red-600;
71
- }
72
- }
73
-
74
- .bui-spinner-rose {
75
- .bui-spinner-animation {
76
- @apply border-rose-100 border-t-rose-600;
77
- }
78
-
79
- .bui-spinner-label {
80
- @apply text-rose-600;
81
- }
82
- }
83
-
84
- .bui-spinner-orange {
85
- .bui-spinner-animation {
86
- @apply border-orange-100 border-t-orange-500;
87
- }
88
-
89
- .bui-spinner-label {
90
- @apply text-orange-500;
91
- }
92
- }
93
-
94
- .bui-spinner-green {
95
- .bui-spinner-animation {
96
- @apply border-green-100 border-t-green-600;
97
- }
98
-
99
- .bui-spinner-label {
100
- @apply text-green-600;
101
- }
102
- }
103
-
104
- .bui-spinner-blue {
105
- .bui-spinner-animation {
106
- @apply border-blue-100 border-t-blue-600;
107
- }
108
-
109
- .bui-spinner-label {
110
- @apply text-blue-600;
111
- }
112
- }
113
-
114
- .bui-spinner-yellow {
115
- .bui-spinner-animation {
116
- @apply border-yellow-100 border-t-yellow-500;
117
- }
118
-
119
- .bui-spinner-label {
120
- @apply text-yellow-500;
121
- }
122
- }
123
-
124
- .bui-spinner-violet {
125
- .bui-spinner-animation {
126
- @apply border-violet-100 border-t-violet-600;
127
- }
128
-
129
- .bui-spinner-label {
130
- @apply text-violet-600;
1
+ @layer components {
2
+ // Classe base per lo spinner (Block)
3
+ .bui-spinner {
4
+ @apply inline-flex flex-col items-center justify-center;
5
+
6
+ // Elements
7
+ &__animation {
8
+ @apply inline-block rounded-full animate-spin;
9
+ border-top-color: transparent;
10
+ }
11
+
12
+ &__label {
13
+ @apply mt-2 text-center;
14
+ }
15
+
16
+ &__content {
17
+ @apply mt-4;
18
+ }
19
+
20
+ // Modifiers (dimensioni)
21
+ &--small &__animation {
22
+ @apply w-5 h-5 border-2;
23
+ }
24
+
25
+ &--medium &__animation {
26
+ @apply w-8 h-8 border-3;
27
+ }
28
+
29
+ &--large &__animation {
30
+ @apply w-12 h-12 border-4;
31
+ }
32
+
33
+ // Modifiers (temi colore)
34
+ &--default {
35
+ .bui-spinner__animation {
36
+ @apply border-gray-200 border-t-gray-800;
37
+ }
38
+
39
+ .bui-spinner__label {
40
+ @apply text-gray-800;
41
+ }
42
+ }
43
+
44
+ &--white {
45
+ .bui-spinner__animation {
46
+ @apply border-gray-100 border-t-white;
47
+ }
48
+
49
+ .bui-spinner__label {
50
+ @apply text-white;
51
+ }
52
+ }
53
+
54
+ &--red {
55
+ .bui-spinner__animation {
56
+ @apply border-red-100 border-t-red-600;
57
+ }
58
+
59
+ .bui-spinner__label {
60
+ @apply text-red-600;
61
+ }
62
+ }
63
+
64
+ &--rose {
65
+ .bui-spinner__animation {
66
+ @apply border-rose-100 border-t-rose-600;
67
+ }
68
+
69
+ .bui-spinner__label {
70
+ @apply text-rose-600;
71
+ }
72
+ }
73
+
74
+ &--orange {
75
+ .bui-spinner__animation {
76
+ @apply border-orange-100 border-t-orange-500;
77
+ }
78
+
79
+ .bui-spinner__label {
80
+ @apply text-orange-500;
81
+ }
82
+ }
83
+
84
+ &--green {
85
+ .bui-spinner__animation {
86
+ @apply border-green-100 border-t-green-600;
87
+ }
88
+
89
+ .bui-spinner__label {
90
+ @apply text-green-600;
91
+ }
92
+ }
93
+
94
+ &--blue {
95
+ .bui-spinner__animation {
96
+ @apply border-blue-100 border-t-blue-600;
97
+ }
98
+
99
+ .bui-spinner__label {
100
+ @apply text-blue-600;
101
+ }
102
+ }
103
+
104
+ &--yellow {
105
+ .bui-spinner__animation {
106
+ @apply border-yellow-100 border-t-yellow-500;
107
+ }
108
+
109
+ .bui-spinner__label {
110
+ @apply text-yellow-500;
111
+ }
112
+ }
113
+
114
+ &--violet {
115
+ .bui-spinner__animation {
116
+ @apply border-violet-100 border-t-violet-600;
117
+ }
118
+
119
+ .bui-spinner__label {
120
+ @apply text-violet-600;
121
+ }
122
+ }
123
+
124
+ // Modifiers (stati)
125
+ &--fullscreen {
126
+ @apply fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50;
127
+ }
131
128
  }
132
129
  }