better_ui 0.3.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.

Potentially problematic release.


This version of better_ui might be problematic. Click here for more details.

Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +140 -230
  4. data/app/assets/stylesheets/better_ui/_base.scss +9 -0
  5. data/app/assets/stylesheets/better_ui/_components.scss +2 -0
  6. data/app/assets/stylesheets/better_ui/_utilities.scss +14 -0
  7. data/app/assets/stylesheets/better_ui/application.css +32 -0
  8. data/app/assets/stylesheets/better_ui/components/_avatar.scss +200 -0
  9. data/app/assets/stylesheets/better_ui/components/_badge.scss +154 -0
  10. data/app/assets/stylesheets/better_ui/components/_breadcrumb.scss +106 -0
  11. data/app/assets/stylesheets/better_ui/components/_button.scss +105 -0
  12. data/app/assets/stylesheets/better_ui/components/_card.scss +60 -0
  13. data/app/assets/stylesheets/better_ui/components/_heading.scss +81 -0
  14. data/app/assets/stylesheets/better_ui/components/_icon.scss +134 -0
  15. data/app/assets/stylesheets/better_ui/components/_index.scss +17 -0
  16. data/app/assets/stylesheets/better_ui/components/_link.scss +100 -0
  17. data/app/assets/stylesheets/better_ui/components/_panel.scss +104 -0
  18. data/app/assets/stylesheets/better_ui/components/_spinner.scss +129 -0
  19. data/app/assets/stylesheets/better_ui/components/_table.scss +156 -0
  20. data/app/assets/stylesheets/better_ui/components/_variables.scss +1 -0
  21. data/app/assets/stylesheets/better_ui.scss +4 -0
  22. data/app/components/better_ui/application/alert_component.html.erb +27 -0
  23. data/app/components/better_ui/application/alert_component.rb +202 -0
  24. data/app/components/better_ui/application/card_component.html.erb +24 -0
  25. data/app/components/better_ui/application/card_component.rb +53 -0
  26. data/app/components/better_ui/application/card_container_component.html.erb +8 -0
  27. data/app/components/better_ui/application/card_container_component.rb +14 -0
  28. data/app/components/better_ui/application/header_component.html.erb +88 -0
  29. data/app/components/better_ui/application/header_component.rb +188 -0
  30. data/app/components/better_ui/application/navbar_component.html.erb +294 -0
  31. data/app/components/better_ui/application/navbar_component.rb +249 -0
  32. data/app/components/better_ui/application/sidebar_component.html.erb +207 -0
  33. data/app/components/better_ui/application/sidebar_component.rb +318 -0
  34. data/app/components/better_ui/application/toast_component.html.erb +35 -0
  35. data/app/components/better_ui/application/toast_component.rb +223 -0
  36. data/app/components/better_ui/general/avatar_component.html.erb +19 -0
  37. data/app/components/better_ui/general/avatar_component.rb +171 -0
  38. data/app/components/better_ui/general/{badge/component.html.erb → badge_component.html.erb} +2 -6
  39. data/app/components/better_ui/general/badge_component.rb +135 -0
  40. data/app/components/better_ui/general/{breadcrumb/component.html.erb → breadcrumb_component.html.erb} +4 -4
  41. data/app/components/better_ui/general/breadcrumb_component.rb +130 -0
  42. data/app/components/better_ui/general/{button/component.html.erb → button_component.html.erb} +7 -7
  43. data/app/components/better_ui/general/button_component.rb +160 -0
  44. data/app/components/better_ui/general/heading_component.html.erb +1 -0
  45. data/app/components/better_ui/general/heading_component.rb +49 -0
  46. data/app/components/better_ui/general/icon_component.html.erb +2 -0
  47. data/app/components/better_ui/general/icon_component.rb +77 -0
  48. data/app/components/better_ui/general/link_component.html.erb +17 -0
  49. data/app/components/better_ui/general/link_component.rb +132 -0
  50. data/app/components/better_ui/general/panel_component.html.erb +27 -0
  51. data/app/components/better_ui/general/panel_component.rb +92 -0
  52. data/app/components/better_ui/general/spinner_component.html.erb +15 -0
  53. data/app/components/better_ui/general/spinner_component.rb +79 -0
  54. data/app/components/better_ui/general/table_component.html.erb +73 -0
  55. data/app/components/better_ui/general/table_component.rb +143 -0
  56. data/app/controllers/better_ui/application_controller.rb +1 -0
  57. data/app/helpers/better_ui/general/components/avatar_helper.rb +17 -0
  58. data/app/helpers/better_ui/general/components/badge_helper.rb +17 -0
  59. data/app/helpers/better_ui/general/components/breadcrumb_helper.rb +17 -0
  60. data/app/helpers/better_ui/general/components/button_helper.rb +17 -0
  61. data/app/helpers/better_ui/general/components/heading_helper.rb +17 -0
  62. data/app/helpers/better_ui/general/components/icon_helper.rb +17 -0
  63. data/app/helpers/better_ui/general/components/link_helper.rb +17 -0
  64. data/app/helpers/better_ui/general/components/panel_helper.rb +16 -0
  65. data/app/helpers/better_ui/general/components/spinner_helper.rb +17 -0
  66. data/app/helpers/better_ui/general/components/table_helper.rb +17 -0
  67. data/app/helpers/better_ui/general_helper.rb +15 -0
  68. data/app/helpers/better_ui_helper.rb +12 -0
  69. data/app/views/components/better_ui/general/table/_custom_body_row.html.erb +17 -0
  70. data/app/views/components/better_ui/general/table/_custom_footer_rows.html.erb +17 -0
  71. data/app/views/components/better_ui/general/table/_custom_header_rows.html.erb +12 -0
  72. data/app/views/layouts/component_preview.html.erb +32 -0
  73. data/config/initializers/lookbook.rb +12 -12
  74. data/config/routes.rb +2 -0
  75. data/lib/better_ui/engine.rb +92 -5
  76. data/lib/better_ui/version.rb +1 -1
  77. data/lib/better_ui.rb +32 -4
  78. data/lib/generators/better_ui/install_generator.rb +103 -0
  79. data/lib/generators/better_ui/stylesheet_generator.rb +159 -0
  80. data/lib/generators/better_ui/templates/README +125 -0
  81. data/lib/generators/better_ui/templates/components/_avatar.scss +200 -0
  82. data/lib/generators/better_ui/templates/components/_badge.scss +154 -0
  83. data/lib/generators/better_ui/templates/components/_breadcrumb.scss +106 -0
  84. data/lib/generators/better_ui/templates/components/_button.scss +109 -0
  85. data/lib/generators/better_ui/templates/components/_card.scss +60 -0
  86. data/lib/generators/better_ui/templates/components/_heading.scss +81 -0
  87. data/lib/generators/better_ui/templates/components/_icon.scss +134 -0
  88. data/lib/generators/better_ui/templates/components/_index.scss +17 -0
  89. data/lib/generators/better_ui/templates/components/_link.scss +100 -0
  90. data/lib/generators/better_ui/templates/components/_panel.scss +104 -0
  91. data/lib/generators/better_ui/templates/components/_spinner.scss +129 -0
  92. data/lib/generators/better_ui/templates/components/_table.scss +156 -0
  93. data/lib/generators/better_ui/templates/components/_variables.scss +0 -0
  94. data/lib/generators/better_ui/templates/components_stylesheet.scss +35 -0
  95. data/lib/generators/better_ui/templates/index.scss +18 -0
  96. data/lib/generators/better_ui/templates/initializer.rb +41 -0
  97. metadata +178 -147
  98. data/app/components/better_ui/application/card/component.html.erb +0 -20
  99. data/app/components/better_ui/application/card/component.rb +0 -214
  100. data/app/components/better_ui/application/main/component.html.erb +0 -9
  101. data/app/components/better_ui/application/main/component.rb +0 -123
  102. data/app/components/better_ui/application/navbar/component.html.erb +0 -92
  103. data/app/components/better_ui/application/navbar/component.rb +0 -136
  104. data/app/components/better_ui/application/sidebar/component.html.erb +0 -227
  105. data/app/components/better_ui/application/sidebar/component.rb +0 -130
  106. data/app/components/better_ui/general/accordion/component.html.erb +0 -5
  107. data/app/components/better_ui/general/accordion/component.rb +0 -92
  108. data/app/components/better_ui/general/accordion/item_component.html.erb +0 -12
  109. data/app/components/better_ui/general/accordion/item_component.rb +0 -176
  110. data/app/components/better_ui/general/alert/component.html.erb +0 -32
  111. data/app/components/better_ui/general/alert/component.rb +0 -242
  112. data/app/components/better_ui/general/avatar/component.html.erb +0 -20
  113. data/app/components/better_ui/general/avatar/component.rb +0 -301
  114. data/app/components/better_ui/general/badge/component.rb +0 -248
  115. data/app/components/better_ui/general/breadcrumb/component.rb +0 -187
  116. data/app/components/better_ui/general/button/component.rb +0 -214
  117. data/app/components/better_ui/general/divider/component.html.erb +0 -10
  118. data/app/components/better_ui/general/divider/component.rb +0 -226
  119. data/app/components/better_ui/general/dropdown/component.html.erb +0 -25
  120. data/app/components/better_ui/general/dropdown/component.rb +0 -170
  121. data/app/components/better_ui/general/dropdown/divider_component.html.erb +0 -1
  122. data/app/components/better_ui/general/dropdown/divider_component.rb +0 -41
  123. data/app/components/better_ui/general/dropdown/item_component.html.erb +0 -6
  124. data/app/components/better_ui/general/dropdown/item_component.rb +0 -119
  125. data/app/components/better_ui/general/field/component.html.erb +0 -27
  126. data/app/components/better_ui/general/field/component.rb +0 -37
  127. data/app/components/better_ui/general/heading/component.html.erb +0 -22
  128. data/app/components/better_ui/general/heading/component.rb +0 -257
  129. data/app/components/better_ui/general/icon/component.html.erb +0 -7
  130. data/app/components/better_ui/general/icon/component.rb +0 -239
  131. data/app/components/better_ui/general/input/checkbox/component.html.erb +0 -5
  132. data/app/components/better_ui/general/input/checkbox/component.rb +0 -238
  133. data/app/components/better_ui/general/input/datetime/component.html.erb +0 -5
  134. data/app/components/better_ui/general/input/datetime/component.rb +0 -223
  135. data/app/components/better_ui/general/input/radio/component.html.erb +0 -5
  136. data/app/components/better_ui/general/input/radio/component.rb +0 -230
  137. data/app/components/better_ui/general/input/select/component.html.erb +0 -16
  138. data/app/components/better_ui/general/input/select/component.rb +0 -184
  139. data/app/components/better_ui/general/input/select/select_component.html.erb +0 -5
  140. data/app/components/better_ui/general/input/select/select_component.rb +0 -37
  141. data/app/components/better_ui/general/input/text/component.html.erb +0 -5
  142. data/app/components/better_ui/general/input/text/component.rb +0 -171
  143. data/app/components/better_ui/general/input/textarea/component.html.erb +0 -5
  144. data/app/components/better_ui/general/input/textarea/component.rb +0 -166
  145. data/app/components/better_ui/general/link/component.html.erb +0 -18
  146. data/app/components/better_ui/general/link/component.rb +0 -258
  147. data/app/components/better_ui/general/modal/component.html.erb +0 -5
  148. data/app/components/better_ui/general/modal/component.rb +0 -47
  149. data/app/components/better_ui/general/modal/modal_component.html.erb +0 -52
  150. data/app/components/better_ui/general/modal/modal_component.rb +0 -160
  151. data/app/components/better_ui/general/pagination/component.html.erb +0 -85
  152. data/app/components/better_ui/general/pagination/component.rb +0 -216
  153. data/app/components/better_ui/general/panel/component.html.erb +0 -28
  154. data/app/components/better_ui/general/panel/component.rb +0 -249
  155. data/app/components/better_ui/general/progress/component.html.erb +0 -11
  156. data/app/components/better_ui/general/progress/component.rb +0 -160
  157. data/app/components/better_ui/general/spinner/component.html.erb +0 -35
  158. data/app/components/better_ui/general/spinner/component.rb +0 -93
  159. data/app/components/better_ui/general/table/component.html.erb +0 -5
  160. data/app/components/better_ui/general/table/component.rb +0 -217
  161. data/app/components/better_ui/general/table/tbody_component.html.erb +0 -3
  162. data/app/components/better_ui/general/table/tbody_component.rb +0 -30
  163. data/app/components/better_ui/general/table/td_component.html.erb +0 -3
  164. data/app/components/better_ui/general/table/td_component.rb +0 -44
  165. data/app/components/better_ui/general/table/tfoot_component.html.erb +0 -3
  166. data/app/components/better_ui/general/table/tfoot_component.rb +0 -28
  167. data/app/components/better_ui/general/table/th_component.html.erb +0 -6
  168. data/app/components/better_ui/general/table/th_component.rb +0 -51
  169. data/app/components/better_ui/general/table/thead_component.html.erb +0 -3
  170. data/app/components/better_ui/general/table/thead_component.rb +0 -28
  171. data/app/components/better_ui/general/table/tr_component.html.erb +0 -3
  172. data/app/components/better_ui/general/table/tr_component.rb +0 -30
  173. data/app/components/better_ui/general/tabs/component.html.erb +0 -11
  174. data/app/components/better_ui/general/tabs/component.rb +0 -120
  175. data/app/components/better_ui/general/tabs/panel_component.html.erb +0 -3
  176. data/app/components/better_ui/general/tabs/panel_component.rb +0 -37
  177. data/app/components/better_ui/general/tabs/tab_component.html.erb +0 -13
  178. data/app/components/better_ui/general/tabs/tab_component.rb +0 -111
  179. data/app/components/better_ui/general/tag/component.html.erb +0 -3
  180. data/app/components/better_ui/general/tag/component.rb +0 -104
  181. data/app/components/better_ui/general/tooltip/component.html.erb +0 -7
  182. data/app/components/better_ui/general/tooltip/component.rb +0 -239
  183. data/app/helpers/better_ui/application/components/card/card_helper.rb +0 -96
  184. data/app/helpers/better_ui/application/components/card.rb +0 -11
  185. data/app/helpers/better_ui/application/components/main/main_helper.rb +0 -64
  186. data/app/helpers/better_ui/application/components/navbar/navbar_helper.rb +0 -77
  187. data/app/helpers/better_ui/application/components/sidebar/sidebar_helper.rb +0 -51
  188. data/app/helpers/better_ui/application_helper.rb +0 -55
  189. data/app/helpers/better_ui/general/components/accordion/accordion_helper.rb +0 -73
  190. data/app/helpers/better_ui/general/components/accordion.rb +0 -11
  191. data/app/helpers/better_ui/general/components/alert/alert_helper.rb +0 -57
  192. data/app/helpers/better_ui/general/components/avatar/avatar_helper.rb +0 -29
  193. data/app/helpers/better_ui/general/components/badge/badge_helper.rb +0 -53
  194. data/app/helpers/better_ui/general/components/breadcrumb/breadcrumb_helper.rb +0 -37
  195. data/app/helpers/better_ui/general/components/button/button_helper.rb +0 -65
  196. data/app/helpers/better_ui/general/components/container/container_helper.rb +0 -60
  197. data/app/helpers/better_ui/general/components/divider/divider_helper.rb +0 -63
  198. data/app/helpers/better_ui/general/components/dropdown/divider_helper.rb +0 -32
  199. data/app/helpers/better_ui/general/components/dropdown/dropdown_helper.rb +0 -79
  200. data/app/helpers/better_ui/general/components/dropdown/item_helper.rb +0 -62
  201. data/app/helpers/better_ui/general/components/field/field_helper.rb +0 -26
  202. data/app/helpers/better_ui/general/components/heading/heading_helper.rb +0 -72
  203. data/app/helpers/better_ui/general/components/icon/icon_helper.rb +0 -16
  204. data/app/helpers/better_ui/general/components/input/checkbox/checkbox_helper.rb +0 -81
  205. data/app/helpers/better_ui/general/components/input/datetime/datetime_helper.rb +0 -91
  206. data/app/helpers/better_ui/general/components/input/radio/radio_helper.rb +0 -79
  207. data/app/helpers/better_ui/general/components/input/radio_group/radio_group_helper.rb +0 -124
  208. data/app/helpers/better_ui/general/components/input/select/select_helper.rb +0 -70
  209. data/app/helpers/better_ui/general/components/input/text/text_helper.rb +0 -138
  210. data/app/helpers/better_ui/general/components/input/textarea/textarea_helper.rb +0 -73
  211. data/app/helpers/better_ui/general/components/link/link_helper.rb +0 -89
  212. data/app/helpers/better_ui/general/components/modal/modal_helper.rb +0 -85
  213. data/app/helpers/better_ui/general/components/modal.rb +0 -11
  214. data/app/helpers/better_ui/general/components/pagination/pagination_helper.rb +0 -82
  215. data/app/helpers/better_ui/general/components/panel/panel_helper.rb +0 -83
  216. data/app/helpers/better_ui/general/components/progress/progress_helper.rb +0 -53
  217. data/app/helpers/better_ui/general/components/spinner/spinner_helper.rb +0 -19
  218. data/app/helpers/better_ui/general/components/table/table_helper.rb +0 -53
  219. data/app/helpers/better_ui/general/components/table/tbody_helper.rb +0 -13
  220. data/app/helpers/better_ui/general/components/table/td_helper.rb +0 -19
  221. data/app/helpers/better_ui/general/components/table/tfoot_helper.rb +0 -13
  222. data/app/helpers/better_ui/general/components/table/th_helper.rb +0 -19
  223. data/app/helpers/better_ui/general/components/table/thead_helper.rb +0 -13
  224. data/app/helpers/better_ui/general/components/table/tr_helper.rb +0 -13
  225. data/app/helpers/better_ui/general/components/tabs/panel_helper.rb +0 -62
  226. data/app/helpers/better_ui/general/components/tabs/tab_helper.rb +0 -55
  227. data/app/helpers/better_ui/general/components/tabs/tabs_helper.rb +0 -95
  228. data/app/helpers/better_ui/general/components/tag/tag_helper.rb +0 -26
  229. data/app/helpers/better_ui/general/components/tooltip/tooltip_helper.rb +0 -60
  230. data/app/views/layouts/better_ui/application.html.erb +0 -17
  231. data/lib/better_ui/railtie.rb +0 -20
@@ -0,0 +1,134 @@
1
+ @layer components {
2
+ // Classe base per l'icona (Block)
3
+ .bui-icon {
4
+ @apply inline-flex items-center justify-center;
5
+
6
+ // Modifiers (dimensioni)
7
+ &--xs {
8
+ @apply h-3 w-3;
9
+
10
+ svg {
11
+ @apply h-3 w-3;
12
+ }
13
+ }
14
+
15
+ &--sm {
16
+ @apply h-4 w-4;
17
+
18
+ svg {
19
+ @apply h-4 w-4;
20
+ }
21
+ }
22
+
23
+ &--md {
24
+ @apply h-5 w-5;
25
+
26
+ svg {
27
+ @apply h-5 w-5;
28
+ }
29
+ }
30
+
31
+ &--lg {
32
+ @apply h-6 w-6;
33
+
34
+ svg {
35
+ @apply h-6 w-6;
36
+ }
37
+ }
38
+
39
+ &--xl {
40
+ @apply h-8 w-8;
41
+
42
+ svg {
43
+ @apply h-8 w-8;
44
+ }
45
+ }
46
+
47
+ // Modifiers (varianti colore)
48
+ &--default {
49
+ @apply text-gray-500;
50
+ }
51
+
52
+ &--white {
53
+ @apply text-white;
54
+ }
55
+
56
+ &--red {
57
+ @apply text-red-500;
58
+ }
59
+
60
+ &--rose {
61
+ @apply text-rose-500;
62
+ }
63
+
64
+ &--orange {
65
+ @apply text-orange-500;
66
+ }
67
+
68
+ &--green {
69
+ @apply text-green-500;
70
+ }
71
+
72
+ &--blue {
73
+ @apply text-blue-500;
74
+ }
75
+
76
+ &--yellow {
77
+ @apply text-yellow-500;
78
+ }
79
+
80
+ &--violet {
81
+ @apply text-violet-500;
82
+ }
83
+
84
+ // Modifiers (varianti stile)
85
+ &--solid {
86
+ @apply rounded-full p-2 bg-gray-100;
87
+ }
88
+
89
+ &--solid-primary {
90
+ @apply rounded-full p-2 text-white;
91
+
92
+ &.bui-icon--red {
93
+ @apply bg-red-500;
94
+ }
95
+
96
+ &.bui-icon--rose {
97
+ @apply bg-rose-500;
98
+ }
99
+
100
+ &.bui-icon--orange {
101
+ @apply bg-orange-500;
102
+ }
103
+
104
+ &.bui-icon--green {
105
+ @apply bg-green-500;
106
+ }
107
+
108
+ &.bui-icon--blue {
109
+ @apply bg-blue-500;
110
+ }
111
+
112
+ &.bui-icon--yellow {
113
+ @apply bg-yellow-500;
114
+ }
115
+
116
+ &.bui-icon--violet {
117
+ @apply bg-violet-500;
118
+ }
119
+ }
120
+
121
+ // Stati
122
+ &--spin {
123
+ @apply animate-spin;
124
+ }
125
+
126
+ &--pulse {
127
+ @apply animate-pulse;
128
+ }
129
+
130
+ &--fixed-width {
131
+ @apply w-5;
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,17 @@
1
+ // Index file che raggruppa e riespone tutti i componenti
2
+ // Nota: È possibile utilizzare le variabili con @use "better_ui/components/variables" as vars;
3
+
4
+ // Componenti generali
5
+ @forward "button";
6
+ @forward "panel";
7
+ @forward "table";
8
+ @forward "badge";
9
+ @forward "avatar";
10
+ @forward "icon";
11
+ @forward "link";
12
+ @forward "heading";
13
+ @forward "breadcrumb";
14
+ @forward "spinner";
15
+
16
+ // Componenti applicativi
17
+ @forward "card";
@@ -0,0 +1,100 @@
1
+ @layer components {
2
+ // Classe base per il link (Block)
3
+ .bui-link {
4
+ @apply inline-flex items-center transition-colors duration-200;
5
+
6
+ // Elements
7
+ &__icon {
8
+ @apply flex-shrink-0;
9
+
10
+ &--left {
11
+ @apply mr-1.5;
12
+ }
13
+
14
+ &--right {
15
+ @apply ml-1.5;
16
+ }
17
+ }
18
+
19
+ &__text {
20
+ @apply inline;
21
+ }
22
+
23
+ // Modifiers (varianti colore)
24
+ &--default {
25
+ @apply text-gray-700 hover:text-gray-900;
26
+ }
27
+
28
+ &--white {
29
+ @apply text-white hover:text-gray-100;
30
+ }
31
+
32
+ &--red {
33
+ @apply text-red-600 hover:text-red-700;
34
+ }
35
+
36
+ &--rose {
37
+ @apply text-rose-600 hover:text-rose-700;
38
+ }
39
+
40
+ &--orange {
41
+ @apply text-orange-600 hover:text-orange-700;
42
+ }
43
+
44
+ &--green {
45
+ @apply text-green-600 hover:text-green-700;
46
+ }
47
+
48
+ &--blue {
49
+ @apply text-blue-600 hover:text-blue-700;
50
+ }
51
+
52
+ &--yellow {
53
+ @apply text-yellow-600 hover:text-yellow-700;
54
+ }
55
+
56
+ &--violet {
57
+ @apply text-violet-600 hover:text-violet-700;
58
+ }
59
+
60
+ // Modifiers (varianti stile)
61
+ &--underlined {
62
+ @apply underline decoration-1 underline-offset-2;
63
+ }
64
+
65
+ &--hover-underlined {
66
+ @apply no-underline hover:underline decoration-1 underline-offset-2;
67
+ }
68
+
69
+ &--bold {
70
+ @apply font-semibold;
71
+ }
72
+
73
+ // Modifiers (dimensioni)
74
+ &--sm {
75
+ @apply text-sm;
76
+ }
77
+
78
+ &--base {
79
+ @apply text-base;
80
+ }
81
+
82
+ &--lg {
83
+ @apply text-lg;
84
+ }
85
+
86
+ // Stati
87
+ &--active {
88
+ @apply font-medium;
89
+ }
90
+
91
+ &--disabled {
92
+ @apply pointer-events-none opacity-50;
93
+ }
94
+
95
+ // Stili specifici per bottoni che sembrano link
96
+ &--button {
97
+ @apply appearance-none bg-transparent border-none p-0 cursor-pointer;
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,104 @@
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
+ }
104
+ }
@@ -0,0 +1,129 @@
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
+ }
128
+ }
129
+ }
@@ -0,0 +1,156 @@
1
+ @layer components {
2
+ // Classe base per la tabella (Block)
3
+ .bui-table {
4
+ @apply w-full border-collapse;
5
+
6
+ // Elements
7
+ &__container {
8
+ @apply overflow-hidden border shadow-sm;
9
+ }
10
+
11
+ &__caption {
12
+ @apply p-4 font-medium text-left;
13
+ }
14
+
15
+ &__header {
16
+ @apply bg-gray-50;
17
+ }
18
+
19
+ &__footer {
20
+ @apply bg-gray-50;
21
+ }
22
+
23
+ &__body {
24
+ // Styling base per il corpo della tabella
25
+ }
26
+
27
+ &__cell {
28
+ @apply px-4 py-3 text-sm text-gray-700;
29
+
30
+ &--header {
31
+ @apply bg-gray-50 text-left text-xs uppercase tracking-wider text-gray-500 font-medium;
32
+ }
33
+
34
+ &--footer {
35
+ @apply font-medium;
36
+ }
37
+ }
38
+
39
+ &__row {
40
+ @apply border-b border-gray-200;
41
+ }
42
+
43
+ // Modifiers (varianti)
44
+ &--default {
45
+ @apply bg-white text-gray-900 border-gray-200;
46
+ }
47
+
48
+ &--red {
49
+ @apply bg-red-50 text-red-900 border-red-200;
50
+
51
+ .bui-table__header {
52
+ @apply bg-red-100;
53
+ }
54
+
55
+ .bui-table__footer {
56
+ @apply bg-red-100;
57
+ }
58
+
59
+ .bui-table__cell--header {
60
+ @apply bg-red-100 text-red-800;
61
+ }
62
+ }
63
+
64
+ &--blue {
65
+ @apply bg-blue-50 text-blue-900 border-blue-200;
66
+
67
+ .bui-table__header {
68
+ @apply bg-blue-100;
69
+ }
70
+
71
+ .bui-table__footer {
72
+ @apply bg-blue-100;
73
+ }
74
+
75
+ .bui-table__cell--header {
76
+ @apply bg-blue-100 text-blue-800;
77
+ }
78
+ }
79
+
80
+ &--green {
81
+ @apply bg-green-50 text-green-900 border-green-200;
82
+
83
+ .bui-table__header {
84
+ @apply bg-green-100;
85
+ }
86
+
87
+ .bui-table__footer {
88
+ @apply bg-green-100;
89
+ }
90
+
91
+ .bui-table__cell--header {
92
+ @apply bg-green-100 text-green-800;
93
+ }
94
+ }
95
+
96
+ // Stati tabella
97
+ &--striped {
98
+ .bui-table__row:nth-child(even) {
99
+ @apply bg-gray-50;
100
+ }
101
+ }
102
+
103
+ &--hoverable {
104
+ .bui-table__row:hover {
105
+ @apply bg-gray-100;
106
+ }
107
+ }
108
+
109
+ &--bordered {
110
+ @apply border;
111
+
112
+ .bui-table__cell {
113
+ @apply border;
114
+ }
115
+ }
116
+
117
+ &--compact {
118
+ .bui-table__cell {
119
+ @apply px-2 py-1 text-xs;
120
+ }
121
+ }
122
+
123
+ // Modifiers (border radius)
124
+ &--radius-none {
125
+ @apply rounded-none;
126
+
127
+ .bui-table__container {
128
+ @apply rounded-none;
129
+ }
130
+ }
131
+
132
+ &--radius-small {
133
+ @apply rounded-md;
134
+
135
+ .bui-table__container {
136
+ @apply rounded-md overflow-hidden;
137
+ }
138
+ }
139
+
140
+ &--radius-medium {
141
+ @apply rounded-lg;
142
+
143
+ .bui-table__container {
144
+ @apply rounded-lg overflow-hidden;
145
+ }
146
+ }
147
+
148
+ &--radius-large {
149
+ @apply rounded-xl;
150
+
151
+ .bui-table__container {
152
+ @apply rounded-xl overflow-hidden;
153
+ }
154
+ }
155
+ }
156
+ }
@@ -0,0 +1,4 @@
1
+ // File principale che importa tutti i moduli
2
+ @use "better_ui/base";
3
+ @use "better_ui/components";
4
+ @use "better_ui/utilities";
@@ -0,0 +1,27 @@
1
+ <div role="alert" class="<%= container_classes %>" <%= @data&.map { |k, v| "data-#{k}=\"#{v}\"" }&.join(' ')&.html_safe %>>
2
+ <% if effective_icon.present? %>
3
+ <div class="<%= icon_classes %>">
4
+ <%= render BetterUi::General::IconComponent.new(name: effective_icon) %>
5
+ </div>
6
+ <% end %>
7
+
8
+ <div class="<%= content_classes %>">
9
+ <% if @title.present? %>
10
+ <div class="<%= title_classes %>"><%= @title %></div>
11
+ <% end %>
12
+
13
+ <% if @message.present? %>
14
+ <div class="<%= message_classes %>"><%= @message %></div>
15
+ <% end %>
16
+
17
+ <% if content.present? %>
18
+ <div class="<%= message_classes %>"><%= content %></div>
19
+ <% end %>
20
+ </div>
21
+
22
+ <% if @dismissible %>
23
+ <button type="button" class="<%= close_button_classes %>" data-dismiss-target="[role='alert']" aria-label="Chiudi">
24
+ <%= render BetterUi::General::IconComponent.new(name: "xmark") %>
25
+ </button>
26
+ <% end %>
27
+ </div>