better_ui 0.3.0 → 0.5.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.

Potentially problematic release.


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

Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +227 -209
  4. data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +138 -0
  5. data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +211 -0
  6. data/app/assets/javascripts/better_ui/controllers/toast_controller.js +161 -0
  7. data/app/assets/javascripts/better_ui/index.js +159 -0
  8. data/app/assets/javascripts/better_ui/toast_manager.js +77 -0
  9. data/app/assets/stylesheets/better_ui/application.css +30 -0
  10. data/app/components/better_ui/application/alert_component.html.erb +27 -0
  11. data/app/components/better_ui/application/alert_component.rb +202 -0
  12. data/app/components/better_ui/application/card_component.html.erb +24 -0
  13. data/app/components/better_ui/application/card_component.rb +53 -0
  14. data/app/components/better_ui/application/card_container_component.html.erb +8 -0
  15. data/app/components/better_ui/application/card_container_component.rb +14 -0
  16. data/app/components/better_ui/application/header_component.html.erb +88 -0
  17. data/app/components/better_ui/application/header_component.rb +188 -0
  18. data/app/components/better_ui/application/navbar_component.html.erb +294 -0
  19. data/app/components/better_ui/application/navbar_component.rb +249 -0
  20. data/app/components/better_ui/application/sidebar_component.html.erb +207 -0
  21. data/app/components/better_ui/application/sidebar_component.rb +318 -0
  22. data/app/components/better_ui/application/toast_component.html.erb +35 -0
  23. data/app/components/better_ui/application/toast_component.rb +223 -0
  24. data/app/components/better_ui/general/avatar_component.html.erb +19 -0
  25. data/app/components/better_ui/general/avatar_component.rb +171 -0
  26. data/app/components/better_ui/general/badge_component.html.erb +19 -0
  27. data/app/components/better_ui/general/badge_component.rb +123 -0
  28. data/app/components/better_ui/general/{breadcrumb/component.html.erb → breadcrumb_component.html.erb} +4 -4
  29. data/app/components/better_ui/general/breadcrumb_component.rb +130 -0
  30. data/app/components/better_ui/general/{button/component.html.erb → button_component.html.erb} +7 -7
  31. data/app/components/better_ui/general/button_component.rb +162 -0
  32. data/app/components/better_ui/general/heading_component.html.erb +25 -0
  33. data/app/components/better_ui/general/heading_component.rb +148 -0
  34. data/app/components/better_ui/general/icon_component.html.erb +2 -0
  35. data/app/components/better_ui/general/icon_component.rb +100 -0
  36. data/app/components/better_ui/general/link_component.html.erb +17 -0
  37. data/app/components/better_ui/general/link_component.rb +132 -0
  38. data/app/components/better_ui/general/panel_component.html.erb +27 -0
  39. data/app/components/better_ui/general/panel_component.rb +103 -0
  40. data/app/components/better_ui/general/spinner_component.html.erb +15 -0
  41. data/app/components/better_ui/general/spinner_component.rb +79 -0
  42. data/app/components/better_ui/general/table_component.html.erb +73 -0
  43. data/app/components/better_ui/general/table_component.rb +167 -0
  44. data/app/components/better_ui/theme_helper.rb +171 -0
  45. data/app/controllers/better_ui/application_controller.rb +1 -0
  46. data/app/controllers/better_ui/docs_controller.rb +34 -0
  47. data/app/views/components/better_ui/general/table/_custom_body_row.html.erb +17 -0
  48. data/app/views/components/better_ui/general/table/_custom_footer_rows.html.erb +17 -0
  49. data/app/views/components/better_ui/general/table/_custom_header_rows.html.erb +12 -0
  50. data/app/views/layouts/component_preview.html.erb +32 -0
  51. data/config/initializers/lookbook.rb +12 -12
  52. data/config/routes.rb +13 -0
  53. data/lib/better_ui/engine.rb +36 -5
  54. data/lib/better_ui/version.rb +1 -1
  55. data/lib/better_ui.rb +24 -4
  56. data/lib/generators/better_ui/stylesheet_generator.rb +96 -0
  57. data/lib/generators/better_ui/templates/README +56 -0
  58. data/lib/generators/better_ui/templates/components/_avatar.scss +151 -0
  59. data/lib/generators/better_ui/templates/components/_badge.scss +142 -0
  60. data/lib/generators/better_ui/templates/components/_breadcrumb.scss +107 -0
  61. data/lib/generators/better_ui/templates/components/_button.scss +106 -0
  62. data/lib/generators/better_ui/templates/components/_card.scss +69 -0
  63. data/lib/generators/better_ui/templates/components/_heading.scss +180 -0
  64. data/lib/generators/better_ui/templates/components/_icon.scss +90 -0
  65. data/lib/generators/better_ui/templates/components/_link.scss +130 -0
  66. data/lib/generators/better_ui/templates/components/_panel.scss +144 -0
  67. data/lib/generators/better_ui/templates/components/_spinner.scss +132 -0
  68. data/lib/generators/better_ui/templates/components/_table.scss +105 -0
  69. data/lib/generators/better_ui/templates/components/_variables.scss +33 -0
  70. data/lib/generators/better_ui/templates/components_stylesheet.scss +66 -0
  71. metadata +145 -156
  72. data/app/components/better_ui/application/card/component.html.erb +0 -20
  73. data/app/components/better_ui/application/card/component.rb +0 -214
  74. data/app/components/better_ui/application/main/component.html.erb +0 -9
  75. data/app/components/better_ui/application/main/component.rb +0 -123
  76. data/app/components/better_ui/application/navbar/component.html.erb +0 -92
  77. data/app/components/better_ui/application/navbar/component.rb +0 -136
  78. data/app/components/better_ui/application/sidebar/component.html.erb +0 -227
  79. data/app/components/better_ui/application/sidebar/component.rb +0 -130
  80. data/app/components/better_ui/general/accordion/component.html.erb +0 -5
  81. data/app/components/better_ui/general/accordion/component.rb +0 -92
  82. data/app/components/better_ui/general/accordion/item_component.html.erb +0 -12
  83. data/app/components/better_ui/general/accordion/item_component.rb +0 -176
  84. data/app/components/better_ui/general/alert/component.html.erb +0 -32
  85. data/app/components/better_ui/general/alert/component.rb +0 -242
  86. data/app/components/better_ui/general/avatar/component.html.erb +0 -20
  87. data/app/components/better_ui/general/avatar/component.rb +0 -301
  88. data/app/components/better_ui/general/badge/component.html.erb +0 -23
  89. data/app/components/better_ui/general/badge/component.rb +0 -248
  90. data/app/components/better_ui/general/breadcrumb/component.rb +0 -187
  91. data/app/components/better_ui/general/button/component.rb +0 -214
  92. data/app/components/better_ui/general/divider/component.html.erb +0 -10
  93. data/app/components/better_ui/general/divider/component.rb +0 -226
  94. data/app/components/better_ui/general/dropdown/component.html.erb +0 -25
  95. data/app/components/better_ui/general/dropdown/component.rb +0 -170
  96. data/app/components/better_ui/general/dropdown/divider_component.html.erb +0 -1
  97. data/app/components/better_ui/general/dropdown/divider_component.rb +0 -41
  98. data/app/components/better_ui/general/dropdown/item_component.html.erb +0 -6
  99. data/app/components/better_ui/general/dropdown/item_component.rb +0 -119
  100. data/app/components/better_ui/general/field/component.html.erb +0 -27
  101. data/app/components/better_ui/general/field/component.rb +0 -37
  102. data/app/components/better_ui/general/heading/component.html.erb +0 -22
  103. data/app/components/better_ui/general/heading/component.rb +0 -257
  104. data/app/components/better_ui/general/icon/component.html.erb +0 -7
  105. data/app/components/better_ui/general/icon/component.rb +0 -239
  106. data/app/components/better_ui/general/input/checkbox/component.html.erb +0 -5
  107. data/app/components/better_ui/general/input/checkbox/component.rb +0 -238
  108. data/app/components/better_ui/general/input/datetime/component.html.erb +0 -5
  109. data/app/components/better_ui/general/input/datetime/component.rb +0 -223
  110. data/app/components/better_ui/general/input/radio/component.html.erb +0 -5
  111. data/app/components/better_ui/general/input/radio/component.rb +0 -230
  112. data/app/components/better_ui/general/input/select/component.html.erb +0 -16
  113. data/app/components/better_ui/general/input/select/component.rb +0 -184
  114. data/app/components/better_ui/general/input/select/select_component.html.erb +0 -5
  115. data/app/components/better_ui/general/input/select/select_component.rb +0 -37
  116. data/app/components/better_ui/general/input/text/component.html.erb +0 -5
  117. data/app/components/better_ui/general/input/text/component.rb +0 -171
  118. data/app/components/better_ui/general/input/textarea/component.html.erb +0 -5
  119. data/app/components/better_ui/general/input/textarea/component.rb +0 -166
  120. data/app/components/better_ui/general/link/component.html.erb +0 -18
  121. data/app/components/better_ui/general/link/component.rb +0 -258
  122. data/app/components/better_ui/general/modal/component.html.erb +0 -5
  123. data/app/components/better_ui/general/modal/component.rb +0 -47
  124. data/app/components/better_ui/general/modal/modal_component.html.erb +0 -52
  125. data/app/components/better_ui/general/modal/modal_component.rb +0 -160
  126. data/app/components/better_ui/general/pagination/component.html.erb +0 -85
  127. data/app/components/better_ui/general/pagination/component.rb +0 -216
  128. data/app/components/better_ui/general/panel/component.html.erb +0 -28
  129. data/app/components/better_ui/general/panel/component.rb +0 -249
  130. data/app/components/better_ui/general/progress/component.html.erb +0 -11
  131. data/app/components/better_ui/general/progress/component.rb +0 -160
  132. data/app/components/better_ui/general/spinner/component.html.erb +0 -35
  133. data/app/components/better_ui/general/spinner/component.rb +0 -93
  134. data/app/components/better_ui/general/table/component.html.erb +0 -5
  135. data/app/components/better_ui/general/table/component.rb +0 -217
  136. data/app/components/better_ui/general/table/tbody_component.html.erb +0 -3
  137. data/app/components/better_ui/general/table/tbody_component.rb +0 -30
  138. data/app/components/better_ui/general/table/td_component.html.erb +0 -3
  139. data/app/components/better_ui/general/table/td_component.rb +0 -44
  140. data/app/components/better_ui/general/table/tfoot_component.html.erb +0 -3
  141. data/app/components/better_ui/general/table/tfoot_component.rb +0 -28
  142. data/app/components/better_ui/general/table/th_component.html.erb +0 -6
  143. data/app/components/better_ui/general/table/th_component.rb +0 -51
  144. data/app/components/better_ui/general/table/thead_component.html.erb +0 -3
  145. data/app/components/better_ui/general/table/thead_component.rb +0 -28
  146. data/app/components/better_ui/general/table/tr_component.html.erb +0 -3
  147. data/app/components/better_ui/general/table/tr_component.rb +0 -30
  148. data/app/components/better_ui/general/tabs/component.html.erb +0 -11
  149. data/app/components/better_ui/general/tabs/component.rb +0 -120
  150. data/app/components/better_ui/general/tabs/panel_component.html.erb +0 -3
  151. data/app/components/better_ui/general/tabs/panel_component.rb +0 -37
  152. data/app/components/better_ui/general/tabs/tab_component.html.erb +0 -13
  153. data/app/components/better_ui/general/tabs/tab_component.rb +0 -111
  154. data/app/components/better_ui/general/tag/component.html.erb +0 -3
  155. data/app/components/better_ui/general/tag/component.rb +0 -104
  156. data/app/components/better_ui/general/tooltip/component.html.erb +0 -7
  157. data/app/components/better_ui/general/tooltip/component.rb +0 -239
  158. data/app/helpers/better_ui/application/components/card/card_helper.rb +0 -96
  159. data/app/helpers/better_ui/application/components/card.rb +0 -11
  160. data/app/helpers/better_ui/application/components/main/main_helper.rb +0 -64
  161. data/app/helpers/better_ui/application/components/navbar/navbar_helper.rb +0 -77
  162. data/app/helpers/better_ui/application/components/sidebar/sidebar_helper.rb +0 -51
  163. data/app/helpers/better_ui/application_helper.rb +0 -55
  164. data/app/helpers/better_ui/general/components/accordion/accordion_helper.rb +0 -73
  165. data/app/helpers/better_ui/general/components/accordion.rb +0 -11
  166. data/app/helpers/better_ui/general/components/alert/alert_helper.rb +0 -57
  167. data/app/helpers/better_ui/general/components/avatar/avatar_helper.rb +0 -29
  168. data/app/helpers/better_ui/general/components/badge/badge_helper.rb +0 -53
  169. data/app/helpers/better_ui/general/components/breadcrumb/breadcrumb_helper.rb +0 -37
  170. data/app/helpers/better_ui/general/components/button/button_helper.rb +0 -65
  171. data/app/helpers/better_ui/general/components/container/container_helper.rb +0 -60
  172. data/app/helpers/better_ui/general/components/divider/divider_helper.rb +0 -63
  173. data/app/helpers/better_ui/general/components/dropdown/divider_helper.rb +0 -32
  174. data/app/helpers/better_ui/general/components/dropdown/dropdown_helper.rb +0 -79
  175. data/app/helpers/better_ui/general/components/dropdown/item_helper.rb +0 -62
  176. data/app/helpers/better_ui/general/components/field/field_helper.rb +0 -26
  177. data/app/helpers/better_ui/general/components/heading/heading_helper.rb +0 -72
  178. data/app/helpers/better_ui/general/components/icon/icon_helper.rb +0 -16
  179. data/app/helpers/better_ui/general/components/input/checkbox/checkbox_helper.rb +0 -81
  180. data/app/helpers/better_ui/general/components/input/datetime/datetime_helper.rb +0 -91
  181. data/app/helpers/better_ui/general/components/input/radio/radio_helper.rb +0 -79
  182. data/app/helpers/better_ui/general/components/input/radio_group/radio_group_helper.rb +0 -124
  183. data/app/helpers/better_ui/general/components/input/select/select_helper.rb +0 -70
  184. data/app/helpers/better_ui/general/components/input/text/text_helper.rb +0 -138
  185. data/app/helpers/better_ui/general/components/input/textarea/textarea_helper.rb +0 -73
  186. data/app/helpers/better_ui/general/components/link/link_helper.rb +0 -89
  187. data/app/helpers/better_ui/general/components/modal/modal_helper.rb +0 -85
  188. data/app/helpers/better_ui/general/components/modal.rb +0 -11
  189. data/app/helpers/better_ui/general/components/pagination/pagination_helper.rb +0 -82
  190. data/app/helpers/better_ui/general/components/panel/panel_helper.rb +0 -83
  191. data/app/helpers/better_ui/general/components/progress/progress_helper.rb +0 -53
  192. data/app/helpers/better_ui/general/components/spinner/spinner_helper.rb +0 -19
  193. data/app/helpers/better_ui/general/components/table/table_helper.rb +0 -53
  194. data/app/helpers/better_ui/general/components/table/tbody_helper.rb +0 -13
  195. data/app/helpers/better_ui/general/components/table/td_helper.rb +0 -19
  196. data/app/helpers/better_ui/general/components/table/tfoot_helper.rb +0 -13
  197. data/app/helpers/better_ui/general/components/table/th_helper.rb +0 -19
  198. data/app/helpers/better_ui/general/components/table/thead_helper.rb +0 -13
  199. data/app/helpers/better_ui/general/components/table/tr_helper.rb +0 -13
  200. data/app/helpers/better_ui/general/components/tabs/panel_helper.rb +0 -62
  201. data/app/helpers/better_ui/general/components/tabs/tab_helper.rb +0 -55
  202. data/app/helpers/better_ui/general/components/tabs/tabs_helper.rb +0 -95
  203. data/app/helpers/better_ui/general/components/tag/tag_helper.rb +0 -26
  204. data/app/helpers/better_ui/general/components/tooltip/tooltip_helper.rb +0 -60
  205. data/app/views/layouts/better_ui/application.html.erb +0 -17
  206. data/lib/better_ui/railtie.rb +0 -20
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BetterUi
4
+ module Generators
5
+ class StylesheetGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('templates', __dir__)
7
+
8
+ desc "Genera un foglio di stile SCSS di base per personalizzare i componenti di BetterUi"
9
+
10
+ class_option :prefix, type: :string, default: "custom",
11
+ desc: "Prefisso da utilizzare per il foglio di stile (default: 'custom')"
12
+
13
+ def create_stylesheet
14
+ # Crea il file principale
15
+ template "components_stylesheet.scss",
16
+ File.join("app/assets/stylesheets", "#{options[:prefix]}_better_ui_components.scss")
17
+
18
+ # Crea la directory dei componenti se non esiste
19
+ directory = File.join("app/assets/stylesheets", "components")
20
+ FileUtils.mkdir_p(directory) unless File.directory?(directory)
21
+
22
+ # Lista dei file dei componenti
23
+ component_files = ['_variables.scss', '_button.scss', '_heading.scss', '_breadcrumb.scss',
24
+ '_link.scss', '_panel.scss', '_icon.scss', '_table.scss', '_badge.scss',
25
+ '_spinner.scss', '_avatar.scss']
26
+
27
+ # Copia i file originali
28
+ component_files.each do |filename|
29
+ copy_file "components/#{filename}", File.join(directory, filename)
30
+ end
31
+ end
32
+
33
+ def create_overrides
34
+ # Crea la directory dei componenti se non esiste
35
+ directory = File.join("app/assets/stylesheets", "components")
36
+ FileUtils.mkdir_p(directory) unless File.directory?(directory)
37
+
38
+ # Lista dei file dei componenti
39
+ component_files = ['_variables.scss', '_button.scss', '_heading.scss', '_breadcrumb.scss',
40
+ '_link.scss', '_panel.scss', '_icon.scss', '_table.scss', '_badge.scss',
41
+ '_spinner.scss', '_avatar.scss']
42
+
43
+ # Crea i file di override
44
+ component_files.each do |filename|
45
+ # Nome del file di override
46
+ override_filename = filename.sub('.scss', '_overrides.scss')
47
+ override_path = File.join(directory, override_filename)
48
+
49
+ # Crea il file di override solo se non esiste già
50
+ unless File.exist?(override_path)
51
+ # Leggi il contenuto del file originale dalla directory templates
52
+ template_path = File.join(self.class.source_root, "components", filename)
53
+
54
+ # Se il file template esiste, crea il file di override
55
+ if File.exist?(template_path)
56
+ original_content = File.read(template_path)
57
+ override_content = generate_empty_override(original_content, filename)
58
+ create_file override_path, override_content
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ def show_readme
65
+ readme "README" if behavior == :invoke
66
+ end
67
+
68
+ private
69
+
70
+ # Genera un file di override vuoto con le stesse classi del file originale
71
+ def generate_empty_override(content, filename)
72
+ component_name = filename.sub('_', '').sub('.scss', '')
73
+ result = "/* ==============================\n"
74
+ result += " * #{component_name.capitalize} Component Overrides\n"
75
+ result += " * ==============================\n"
76
+ result += " * Questo file contiene le classi vuote per sovrascrivere gli stili di default.\n"
77
+ result += " * Aggiungi qui le tue personalizzazioni.\n"
78
+ result += " */\n\n"
79
+
80
+ # Estrae le classi tramite regex
81
+ class_matches = content.scan(/\.(bui-[a-zA-Z0-9_-]+)\s*\{/)
82
+ class_matches.flatten.uniq.each do |css_class|
83
+ result += ".#{css_class} {\n // Sovrascrivi qui gli stili per .#{css_class}\n}\n\n"
84
+ end
85
+
86
+ # Estrae anche classi annidate usando la sintassi SCSS
87
+ nested_matches = content.scan(/\.(bui-[a-zA-Z0-9_-]+)\s*{[^{]*\.([\w-]+)\s*{/)
88
+ nested_matches.each do |parent_class, child_class|
89
+ result += ".#{parent_class} {\n .#{child_class} {\n // Sovrascrivi qui gli stili annidati\n }\n}\n\n"
90
+ end
91
+
92
+ result
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,56 @@
1
+ ===============================================================================
2
+
3
+ Installazione completata!
4
+
5
+ Il tuo foglio di stile SCSS per la personalizzazione dei componenti di BetterUi
6
+ è stato creato in:
7
+
8
+ app/assets/stylesheets/<%= options[:prefix] %>_better_ui_components.scss
9
+
10
+ ===============================================================================
11
+
12
+ PROSSIMI PASSI:
13
+
14
+ 1. Assicurati che Tailwind CSS sia correttamente configurato nel tuo progetto.
15
+ Questo foglio di stile utilizza le utility @apply di Tailwind CSS.
16
+
17
+ 2. Importa il foglio di stile nella tua applicazione:
18
+
19
+ In app/assets/stylesheets/application.scss:
20
+
21
+ @import '<%= options[:prefix] %>_better_ui_components';
22
+
23
+ Oppure in app/assets/stylesheets/application.css:
24
+
25
+ /*
26
+ *= require <%= options[:prefix] %>_better_ui_components
27
+ */
28
+
29
+ 3. Personalizza le variabili SCSS e le classi secondo le tue esigenze.
30
+ Il foglio di stile utilizza le classi di Tailwind CSS tramite la direttiva
31
+ @apply, consentendoti di sfruttare l'ecosistema Tailwind mantenendo un
32
+ codice SCSS organizzato e modulare.
33
+
34
+ 4. Nei componenti Ruby, usa le classi con prefisso 'bui-' invece di includere
35
+ direttamente le classi Tailwind. Ad esempio per i bottoni:
36
+
37
+ # Esempio di utilizzo di classi CSS personalizzate
38
+ BUTTON_TYPES = {
39
+ default: "bui-btn-default",
40
+ red: "bui-btn-red",
41
+ blue: "bui-btn-blue"
42
+ }
43
+
44
+ Questo approccio centralizza gli stili nel foglio SCSS e rende più facile
45
+ mantenere e modificare l'aspetto dei componenti.
46
+
47
+ 5. Assicurati che il tuo foglio di stile venga caricato dopo i fogli di stile
48
+ di BetterUI per sovrascrivere correttamente gli stili predefiniti.
49
+
50
+ ===============================================================================
51
+
52
+ Per ulteriori informazioni sulla personalizzazione dei componenti,
53
+ consulta la documentazione ufficiale su:
54
+ https://github.com/YOUR_USERNAME/better_ui
55
+
56
+ ===============================================================================
@@ -0,0 +1,151 @@
1
+ /* ==============================
2
+ * Avatar Component
3
+ * ============================== */
4
+
5
+ /* Stile base */
6
+ .bui-avatar {
7
+ @apply relative inline-flex items-center justify-center;
8
+ @apply box-border;
9
+ @apply overflow-hidden;
10
+ }
11
+
12
+ /* Dimensioni */
13
+ .bui-avatar-size-xxsmall {
14
+ @apply w-5 h-5;
15
+ @apply text-[0.625rem];
16
+ }
17
+
18
+ .bui-avatar-size-xsmall {
19
+ @apply w-6 h-6;
20
+ @apply text-xs;
21
+ }
22
+
23
+ .bui-avatar-size-small {
24
+ @apply w-8 h-8;
25
+ @apply text-sm;
26
+ }
27
+
28
+ .bui-avatar-size-medium {
29
+ @apply w-10 h-10;
30
+ @apply text-base;
31
+ }
32
+
33
+ .bui-avatar-size-large {
34
+ @apply w-12 h-12;
35
+ @apply text-lg;
36
+ }
37
+
38
+ .bui-avatar-size-xlarge {
39
+ @apply w-16 h-16;
40
+ @apply text-xl;
41
+ }
42
+
43
+ .bui-avatar-size-xxlarge {
44
+ @apply w-24 h-24;
45
+ @apply text-2xl;
46
+ }
47
+
48
+ /* Forme */
49
+ .bui-avatar-shape-circle {
50
+ @apply rounded-full;
51
+ }
52
+
53
+ .bui-avatar-shape-square {
54
+ @apply rounded-none;
55
+ }
56
+
57
+ .bui-avatar-shape-rounded {
58
+ @apply rounded-md;
59
+ }
60
+
61
+ /* Immagine */
62
+ .bui-avatar-image {
63
+ @apply w-full h-full object-cover;
64
+ }
65
+
66
+ /* Iniziali di fallback */
67
+ .bui-avatar-initials {
68
+ @apply w-full h-full flex items-center justify-center font-medium text-white;
69
+ }
70
+
71
+ /* Temi di colore */
72
+ .bui-avatar-default {
73
+ @apply bg-gray-700 text-white;
74
+ }
75
+
76
+ .bui-avatar-white {
77
+ @apply bg-white text-gray-800 border border-gray-200;
78
+ }
79
+
80
+ .bui-avatar-red {
81
+ @apply bg-red-500 text-white;
82
+ }
83
+
84
+ .bui-avatar-rose {
85
+ @apply bg-rose-500 text-white;
86
+ }
87
+
88
+ .bui-avatar-orange {
89
+ @apply bg-orange-500 text-white;
90
+ }
91
+
92
+ .bui-avatar-green {
93
+ @apply bg-green-500 text-white;
94
+ }
95
+
96
+ .bui-avatar-blue {
97
+ @apply bg-blue-500 text-white;
98
+ }
99
+
100
+ .bui-avatar-yellow {
101
+ @apply bg-yellow-500 text-black;
102
+ }
103
+
104
+ .bui-avatar-violet {
105
+ @apply bg-violet-500 text-white;
106
+ }
107
+
108
+ .bui-avatar-gray {
109
+ @apply bg-gray-400 text-white;
110
+ }
111
+
112
+ /* Indicatore di stato */
113
+ .bui-avatar-status-indicator {
114
+ @apply absolute block rounded-full border-2 border-white;
115
+ @apply w-3 h-3;
116
+ @apply z-10;
117
+ }
118
+
119
+ /* Posizioni dell'indicatore di stato */
120
+ .bui-avatar-status-position-bottom-right {
121
+ @apply bottom-0 right-0;
122
+ }
123
+
124
+ .bui-avatar-status-position-bottom-left {
125
+ @apply bottom-0 left-0;
126
+ }
127
+
128
+ .bui-avatar-status-position-top-right {
129
+ @apply top-0 right-0;
130
+ }
131
+
132
+ .bui-avatar-status-position-top-left {
133
+ @apply top-0 left-0;
134
+ }
135
+
136
+ /* Varianti di stato */
137
+ .bui-avatar-status-online {
138
+ @apply bg-green-500;
139
+ }
140
+
141
+ .bui-avatar-status-offline {
142
+ @apply bg-gray-400;
143
+ }
144
+
145
+ .bui-avatar-status-busy {
146
+ @apply bg-red-500;
147
+ }
148
+
149
+ .bui-avatar-status-away {
150
+ @apply bg-yellow-500;
151
+ }
@@ -0,0 +1,142 @@
1
+ /* ==============================
2
+ * Badge Component
3
+ * ============================== */
4
+
5
+ /* Stile base */
6
+ .bui-badge {
7
+ @apply inline-flex items-center justify-center;
8
+ @apply font-medium whitespace-nowrap;
9
+ @apply transition-colors;
10
+ }
11
+
12
+ /* Posizionamento icone */
13
+ .bui-badge-icon-left {
14
+ @apply mr-1;
15
+ }
16
+
17
+ .bui-badge-icon-right {
18
+ @apply ml-1;
19
+ }
20
+
21
+ /* Varianti di dimensione */
22
+ .bui-badge-size-small {
23
+ @apply py-0.5 px-1.5 text-xs;
24
+ }
25
+
26
+ .bui-badge-size-medium {
27
+ @apply py-1 px-2 text-sm;
28
+ }
29
+
30
+ .bui-badge-size-large {
31
+ @apply py-1.5 px-3 text-base;
32
+ }
33
+
34
+ /* Varianti di border-radius */
35
+ .bui-badge-radius-none {
36
+ @apply rounded-none;
37
+ }
38
+
39
+ .bui-badge-radius-small {
40
+ @apply rounded;
41
+ }
42
+
43
+ .bui-badge-radius-medium {
44
+ @apply rounded-md;
45
+ }
46
+
47
+ .bui-badge-radius-large {
48
+ @apply rounded-lg;
49
+ }
50
+
51
+ .bui-badge-radius-full {
52
+ @apply rounded-full;
53
+ }
54
+
55
+ /* Varianti stile */
56
+ .bui-badge-outline {
57
+ @apply bg-transparent border;
58
+ }
59
+
60
+ .bui-badge-notification {
61
+ @apply absolute -top-1 -right-1 min-w-[1.25rem] h-5 py-0 px-1.5;
62
+ @apply flex items-center justify-center text-xs;
63
+ @apply rounded-full;
64
+ }
65
+
66
+ /* Varianti di colore - Standard */
67
+ .bui-badge-default {
68
+ @apply bg-gray-800 text-white;
69
+ }
70
+
71
+ .bui-badge-white {
72
+ @apply bg-white text-gray-800 border border-gray-200;
73
+ }
74
+
75
+ .bui-badge-red {
76
+ @apply bg-red-500 text-white;
77
+ }
78
+
79
+ .bui-badge-rose {
80
+ @apply bg-rose-500 text-white;
81
+ }
82
+
83
+ .bui-badge-orange {
84
+ @apply bg-orange-500 text-white;
85
+ }
86
+
87
+ .bui-badge-green {
88
+ @apply bg-green-500 text-white;
89
+ }
90
+
91
+ .bui-badge-blue {
92
+ @apply bg-blue-500 text-white;
93
+ }
94
+
95
+ .bui-badge-yellow {
96
+ @apply bg-yellow-500 text-black;
97
+ }
98
+
99
+ .bui-badge-violet {
100
+ @apply bg-violet-500 text-white;
101
+ }
102
+
103
+ .bui-badge-gray {
104
+ @apply bg-gray-200 text-gray-800;
105
+ }
106
+
107
+ /* Varianti di colore - Outline */
108
+ .bui-badge-outline.bui-badge-default {
109
+ @apply border-gray-800 text-gray-800;
110
+ }
111
+
112
+ .bui-badge-outline.bui-badge-red {
113
+ @apply border-red-500 text-red-600;
114
+ }
115
+
116
+ .bui-badge-outline.bui-badge-rose {
117
+ @apply border-rose-500 text-rose-600;
118
+ }
119
+
120
+ .bui-badge-outline.bui-badge-orange {
121
+ @apply border-orange-500 text-orange-600;
122
+ }
123
+
124
+ .bui-badge-outline.bui-badge-green {
125
+ @apply border-green-500 text-green-600;
126
+ }
127
+
128
+ .bui-badge-outline.bui-badge-blue {
129
+ @apply border-blue-500 text-blue-600;
130
+ }
131
+
132
+ .bui-badge-outline.bui-badge-yellow {
133
+ @apply border-yellow-500 text-yellow-600;
134
+ }
135
+
136
+ .bui-badge-outline.bui-badge-violet {
137
+ @apply border-violet-500 text-violet-600;
138
+ }
139
+
140
+ .bui-badge-outline.bui-badge-gray {
141
+ @apply border-gray-300 text-gray-600;
142
+ }
@@ -0,0 +1,107 @@
1
+ /* ==============================
2
+ * Breadcrumb Component
3
+ * ============================== */
4
+
5
+ /* Classi di base per il container e gli elementi */
6
+ .bui-breadcrumb-container {
7
+ @apply flex items-center flex-wrap;
8
+ }
9
+
10
+ .bui-breadcrumb-list {
11
+ @apply flex flex-wrap items-center;
12
+ }
13
+
14
+ .bui-breadcrumb-item {
15
+ @apply flex items-center;
16
+ }
17
+
18
+ .bui-breadcrumb-separator {
19
+ @apply mx-2;
20
+ }
21
+
22
+ /* Dimensioni */
23
+ .bui-breadcrumb-small {
24
+ @apply text-xs;
25
+ }
26
+
27
+ .bui-breadcrumb-medium {
28
+ @apply text-sm;
29
+ }
30
+
31
+ .bui-breadcrumb-large {
32
+ @apply text-base;
33
+ }
34
+
35
+ /* Temi colore - Container */
36
+ .bui-breadcrumb-default-container {
37
+ @apply text-white;
38
+ }
39
+
40
+ .bui-breadcrumb-white-container {
41
+ @apply text-black;
42
+ }
43
+
44
+ .bui-breadcrumb-red-container {
45
+ @apply text-white;
46
+ }
47
+
48
+ .bui-breadcrumb-rose-container {
49
+ @apply text-white;
50
+ }
51
+
52
+ .bui-breadcrumb-orange-container {
53
+ @apply text-white;
54
+ }
55
+
56
+ .bui-breadcrumb-green-container {
57
+ @apply text-white;
58
+ }
59
+
60
+ .bui-breadcrumb-blue-container {
61
+ @apply text-white;
62
+ }
63
+
64
+ .bui-breadcrumb-yellow-container {
65
+ @apply text-black;
66
+ }
67
+
68
+ .bui-breadcrumb-violet-container {
69
+ @apply text-white;
70
+ }
71
+
72
+ /* Temi colore - Separatori */
73
+ .bui-breadcrumb-default-separator {
74
+ @apply text-gray-500;
75
+ }
76
+
77
+ .bui-breadcrumb-white-separator {
78
+ @apply text-gray-400;
79
+ }
80
+
81
+ .bui-breadcrumb-red-separator {
82
+ @apply text-red-300;
83
+ }
84
+
85
+ .bui-breadcrumb-rose-separator {
86
+ @apply text-rose-300;
87
+ }
88
+
89
+ .bui-breadcrumb-orange-separator {
90
+ @apply text-orange-300;
91
+ }
92
+
93
+ .bui-breadcrumb-green-separator {
94
+ @apply text-green-300;
95
+ }
96
+
97
+ .bui-breadcrumb-blue-separator {
98
+ @apply text-blue-300;
99
+ }
100
+
101
+ .bui-breadcrumb-yellow-separator {
102
+ @apply text-yellow-600;
103
+ }
104
+
105
+ .bui-breadcrumb-violet-separator {
106
+ @apply text-violet-300;
107
+ }
@@ -0,0 +1,106 @@
1
+ /* ==============================
2
+ * Button Component
3
+ * ============================== */
4
+
5
+ /* Stile base */
6
+ .bui-btn {
7
+ @apply py-2 px-4 font-medium rounded transition-colors;
8
+ }
9
+
10
+ /* Layout e posizionamento */
11
+ .bui-btn-layout-default {
12
+ @apply inline-flex items-center justify-center font-medium;
13
+ }
14
+
15
+ .bui-btn-focus {
16
+ @apply focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500;
17
+ }
18
+
19
+ /* Varianti di colore */
20
+ .bui-btn-default {
21
+ @apply bg-black text-white hover:bg-gray-900;
22
+ }
23
+
24
+ .bui-btn-white {
25
+ @apply bg-white text-black hover:bg-gray-100;
26
+ }
27
+
28
+ .bui-btn-red {
29
+ @apply bg-red-500 text-white hover:bg-red-600;
30
+ }
31
+
32
+ .bui-btn-rose {
33
+ @apply bg-rose-500 text-white hover:bg-rose-600;
34
+ }
35
+
36
+ .bui-btn-orange {
37
+ @apply bg-orange-500 text-white hover:bg-orange-600;
38
+ }
39
+
40
+ .bui-btn-green {
41
+ @apply bg-green-500 text-white hover:bg-green-600;
42
+ }
43
+
44
+ .bui-btn-blue {
45
+ @apply bg-blue-500 text-white hover:bg-blue-600;
46
+ }
47
+
48
+ .bui-btn-yellow {
49
+ @apply bg-yellow-500 text-black hover:bg-yellow-600;
50
+ }
51
+
52
+ .bui-btn-violet {
53
+ @apply bg-violet-500 text-white hover:bg-violet-600;
54
+ }
55
+
56
+ /* Varianti di dimensione */
57
+ .bui-btn-size-small {
58
+ @apply py-1 px-2.5 text-xs;
59
+ }
60
+
61
+ .bui-btn-size-medium {
62
+ @apply py-2 px-4 text-sm;
63
+ }
64
+
65
+ .bui-btn-size-large {
66
+ @apply py-2.5 px-6 text-base;
67
+ }
68
+
69
+ /* Varianti di border-radius */
70
+ .bui-btn-radius-none {
71
+ @apply rounded-none;
72
+ }
73
+
74
+ .bui-btn-radius-small {
75
+ @apply rounded-md;
76
+ }
77
+
78
+ .bui-btn-radius-medium {
79
+ @apply rounded-lg;
80
+ }
81
+
82
+ .bui-btn-radius-large {
83
+ @apply rounded-xl;
84
+ }
85
+
86
+ .bui-btn-radius-full {
87
+ @apply rounded-full;
88
+ }
89
+
90
+ /* Stati e modificatori */
91
+ .bui-btn-disabled {
92
+ @apply opacity-50 cursor-not-allowed;
93
+ }
94
+
95
+ .bui-btn-full-width {
96
+ @apply w-full;
97
+ }
98
+
99
+ /* Posizionamento icone */
100
+ .bui-btn-icon-left {
101
+ @apply mr-2;
102
+ }
103
+
104
+ .bui-btn-icon-right {
105
+ @apply ml-2;
106
+ }