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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f8b92fdba76f5e84f09fb6a3bf9879b209e0e7dfd8f864186784db24b808c59
4
- data.tar.gz: 4d21e971baeecb10c7a3c5952041ac7e6911342e0efe4d0015efb92f9f214652
3
+ metadata.gz: ee8e6a1b636ddcd65276d5c410c5b0c9a239d236cdbf507d168bb68abe63c12d
4
+ data.tar.gz: 930f7752b6c813943b49d29bd635da5109355f036eea0bf1d5fc9aed45932173
5
5
  SHA512:
6
- metadata.gz: 778ee8d067130b37947a227ccf1322e8cf5b82d19c9b3f7a0371cc16b62071daaeb5eb6a191898ef2b06419486fe656bc22bea4314fbf98884fdf16259ac8409
7
- data.tar.gz: 1df545b428bdb281fb6f78b7be2e58e455bd6bd67f0202684f51b9e756c9ccc3e928a283f97d98a924185e1bb859b63f8cf2a91857ef49478cf6bfc3f254629d
6
+ metadata.gz: f91edcfb87541fbdeb97e2bc3899c1b1d3a8508bd94a6e6a9955ea56940830cfcc98df3e23f82e9bcb975039b6d3122c36f7c0e75316822ec11f03d206105647
7
+ data.tar.gz: 9422f6159176dc75cd254009f55660831aca51c98e7a4d829a5ab6b4911d5fc569f44ae05c549a452d5fd403a844a1b589642244c1922f485f59874094618921
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright Umberto Peserico
1
+ Copyright alessiobussolari
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,301 +1,211 @@
1
- # BetterUI
1
+ # Better UI
2
2
 
3
- Una libreria completa di componenti UI per applicazioni Rails costruita con ViewComponent e Tailwind CSS. Include 26 componenti con un sistema di design unificato e documentazione interattiva.
3
+ [![Gem Version](https://badge.fury.io/rb/better_ui.svg)](https://badge.fury.io/rb/better_ui)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- - 🎨 **Componenti Eleganti**: Componenti UI pre-costruiti con styling Tailwind CSS
6
- - 📖 **Documentazione Interattiva**: Preview Lookbook integrate per tutti i componenti
7
- - 🔧 **Altamente Personalizzabile**: Opzioni di configurazione flessibili per ogni componente
8
- - 🚀 **Production Ready**: Componenti testati che seguono le best practices
9
- - 📱 **Responsive**: Tutti i componenti sono mobile-first e responsive
10
- - ♿ **Accessibile**: Costruiti pensando all'accessibilità
6
+ A comprehensive UI component library for Rails applications built with ViewComponent and Tailwind CSS, following BEM methodology.
11
7
 
12
- ## Panoramica
8
+ ![Better UI Components](https://via.placeholder.com/800x400?text=Better+UI+Components)
13
9
 
14
- Better UI è una gem Rails che fornisce una collezione di componenti UI riutilizzabili costruiti con ViewComponent e Tailwind CSS. Include un sistema di design unificato con tematizzazione consistente e gestione completa dei form.
10
+ ## Table of Contents
15
11
 
16
- ### Caratteristiche Principali
12
+ - [Overview](#overview)
13
+ - [Installation](#installation)
14
+ - [Basic Installation](#basic-installation)
15
+ - [Advanced Installation Options](#advanced-installation-options)
16
+ - [Tailwind CSS Configuration](#tailwind-css-configuration)
17
+ - [Documentation](#documentation)
18
+ - [Usage](#usage)
19
+ - [Customization](#customization)
20
+ - [Components](#components)
21
+ - [Testing](#testing)
22
+ - [Contributing](#contributing)
23
+ - [License](#license)
24
+ - [Resources](#resources)
17
25
 
18
- - **Solo TailwindCSS**: Approccio puro Tailwind senza file CSS/SCSS personalizzati
19
- - **26 Componenti**: Libreria completa organizzata per scopo
20
- - **Sistema Input Unificato**: Componenti input supportano 14+ tipi (text, email, password, number, date, time, etc.)
21
- - **Documentazione Interattiva**: Integrazione Lookbook con preview live
22
- - **Sistema Helper**: Helper Rails-friendly con integrazione form builder
23
- - **Tematizzazione Consistente**: 9 temi standard (default, white, red, rose, orange, green, blue, yellow, violet)
24
- - **Dimensionamento Flessibile**: 3 dimensioni standard (small, medium, large) con 5 opzioni border radius
25
- - **Accessibilità**: Componenti progettati seguendo le best practices di accessibilità
26
+ ## Overview
26
27
 
27
- ## Installazione
28
+ Better UI is a Rails gem that provides a collection of reusable UI components built with ViewComponent and Tailwind CSS. It follows the BEM (Block Element Modifier) methodology to ensure consistent naming and styling conventions.
28
29
 
29
- Aggiungi questa riga al Gemfile della tua applicazione:
30
+ Key features:
31
+ - **Modern Sass Architecture**: Uses `@use` and `@forward` instead of deprecated `@import`
32
+ - **Modular Components**: Each component is isolated and can be used independently
33
+ - **Customizable**: Override components styles with your own customizations
34
+ - **Interactive Documentation**: Built-in documentation viewer with Lookbook
35
+ - **Responsive Design**: All components are responsive by default
36
+ - **Accessibility**: Components are designed with accessibility in mind
30
37
 
31
- ```ruby
32
- gem "better_ui"
33
- ```
38
+ For more detailed information, see the [components documentation](COMPONENTS.md).
39
+
40
+ ## Installation
41
+
42
+ ### Basic Installation
34
43
 
35
- Per lo sviluppo con documentazione Lookbook:
44
+ 1. Add the gem to your Gemfile:
36
45
 
37
46
  ```ruby
38
- gem "better_ui"
39
- gem "lookbook", group: :development
47
+ gem 'better_ui'
40
48
  ```
41
49
 
42
- Quindi esegui:
50
+ 2. Run bundle install:
43
51
 
44
52
  ```bash
45
- $ bundle install
53
+ bundle install
46
54
  ```
47
55
 
48
- ## Setup
49
-
50
- ### 1. Mount Engine (Opzionale)
51
-
52
- Se vuoi accedere alle route interne di BetterUI, monta l'engine in `config/routes.rb`:
56
+ 3. Run the installer:
53
57
 
54
- ```ruby
55
- Rails.application.routes.draw do
56
- mount BetterUi::Engine => "/better_ui"
57
- # le tue altre route...
58
- end
58
+ ```bash
59
+ bin/rails generate better_ui:install
59
60
  ```
60
61
 
61
- ### 2. Setup Lookbook (Raccomandato per Development)
62
-
63
- Per accedere alla documentazione interattiva dei componenti durante lo sviluppo, monta Lookbook in `config/routes.rb`:
64
-
65
- ```ruby
66
- Rails.application.routes.draw do
67
- # Monta Lookbook solo in development
68
- mount Lookbook::Engine => "/lookbook" if Rails.env.development?
69
-
70
- # le tue altre route...
71
- end
72
- ```
62
+ The installer will:
63
+ - Mount the Better UI engine at `/better_ui`
64
+ - Add the necessary assets to your application
65
+ - Create a configuration file at `config/initializers/better_ui.rb`
66
+ - Generate customizable stylesheets in `app/assets/stylesheets/components/`
73
67
 
74
- **Fatto!** I componenti BetterUI e le loro preview sono automaticamente disponibili in Lookbook.
68
+ ### Advanced Installation Options
75
69
 
76
- ### 3. Includi Tailwind CSS
70
+ You can customize the installation process with the following options:
77
71
 
78
- Assicurati che la tua applicazione includa Tailwind CSS, dato che i componenti BetterUI si basano sulle classi Tailwind. Se non hai Tailwind CSS installato, segui la [guida ufficiale di installazione Tailwind CSS](https://tailwindcss.com/docs/guides/ruby-on-rails).
72
+ ```bash
73
+ # Skip mounting the engine in routes
74
+ bin/rails generate better_ui:install --skip-routes
79
75
 
80
- ## Utilizzo
76
+ # Skip generating stylesheets
77
+ bin/rails generate better_ui:install --skip-stylesheets
81
78
 
82
- I componenti Better UI possono essere utilizzati in due modi: istanziazione diretta o metodi helper.
79
+ # Skip creating the configuration file
80
+ bin/rails generate better_ui:install --skip-config
83
81
 
84
- ### Metodi Helper (Raccomandato)
82
+ # All options together
83
+ bin/rails generate better_ui:install --skip-routes --skip-stylesheets --skip-config
84
+ ```
85
85
 
86
- ```erb
87
- <%# Input di testo con validazione %>
88
- <%= bui_input_text(
89
- name: 'email',
90
- value: @user.email,
91
- type: :email,
92
- theme: :blue,
93
- size: :large,
94
- required: true
95
- ) %>
86
+ ### Tailwind CSS Configuration
96
87
 
97
- <%# Button con theme e size %>
98
- <%= bui_button(
99
- 'Invia Form',
100
- theme: :green,
101
- size: :large,
102
- type: :submit
103
- ) %>
88
+ Better UI requires Tailwind CSS to be properly configured in your application. If you haven't already set up Tailwind CSS, follow these steps:
104
89
 
105
- <%# Card con blocco di contenuto %>
106
- <%= bui_card(title: 'Profilo Utente', theme: :white) do %>
107
- <p>Contenuto informazioni utente qui</p>
108
- <% end %>
90
+ 1. Install Tailwind CSS in your Rails application:
109
91
 
110
- <%# Integrazione con form %>
111
- <%= form_with model: @user do |form| %>
112
- <%= bui_input_text(name: 'name', form: form, required: true) %>
113
- <%= bui_input_text(name: 'email', type: :email, form: form) %>
114
- <%= bui_button('Salva', type: :submit, theme: :blue) %>
115
- <% end %>
92
+ ```bash
93
+ bin/rails tailwindcss:install
116
94
  ```
117
95
 
118
- ### Istanziazione Diretta
119
-
120
- ```erb
121
- <%# Rendering diretto del componente %>
122
- <%= render BetterUi::General::Input::Text::Component.new(
123
- name: 'username',
124
- type: :text,
125
- theme: :default,
126
- size: :medium
127
- ) %>
128
-
129
- <%# Componente button %>
130
- <%= render BetterUi::General::Button::Component.new(
131
- 'Cliccami',
132
- theme: :blue,
133
- size: :large
134
- ) %>
96
+ 2. Configure Tailwind to include Better UI's components:
97
+
98
+ In your `tailwind.config.js` file, add:
99
+
100
+ ```javascript
101
+ module.exports = {
102
+ content: [
103
+ './app/views/**/*.{html,html.erb,erb}',
104
+ './app/helpers/**/*.rb',
105
+ './app/javascript/**/*.js',
106
+ './app/components/**/*.{rb,html,html.erb,erb}',
107
+ // Add this line for Better UI components
108
+ './app/components/better_ui/**/*.{rb,html,html.erb,erb}'
109
+ ],
110
+ // other configurations...
111
+ }
135
112
  ```
136
113
 
137
- ### Sistema di Tematizzazione
138
-
139
- Tutti i componenti supportano tematizzazione consistente:
114
+ For more detailed installation instructions, see [INSTALLATION.md](INSTALLATION.md).
140
115
 
141
- - **9 Temi Standard**: default, white, red, rose, orange, green, blue, yellow, violet
142
- - **3 Dimensioni Standard**: small, medium, large
143
- - **5 Opzioni Border Radius**: none, small, medium, large, full
116
+ ## Documentation
144
117
 
145
- ### Approccio Styling
118
+ After installation, you can access the interactive documentation at:
146
119
 
147
- Better UI usa un approccio TailwindCSS puro con costanti per styling manutenibile:
148
-
149
- ```ruby
150
- # Le costanti del componente definiscono le opzioni di styling
151
- BUTTON_THEME_CLASSES = {
152
- default: 'bg-gray-100 text-gray-900 hover:bg-gray-200',
153
- blue: 'bg-blue-600 text-white hover:bg-blue-700',
154
- green: 'bg-green-600 text-white hover:bg-green-700'
155
- }.freeze
156
-
157
- BUTTON_SIZE_CLASSES = {
158
- small: 'px-3 py-1.5 text-sm',
159
- medium: 'px-4 py-2 text-base',
160
- large: 'px-6 py-3 text-lg'
161
- }.freeze
120
+ ```
121
+ http://localhost:3000/better_ui
162
122
  ```
163
123
 
164
- ## Componenti Disponibili
165
-
166
- Better UI include 26 componenti organizzati in tre categorie:
167
-
168
- ### Componenti Application (4)
169
-
170
- Componenti di layout e navigazione per interfacce applicative:
171
-
172
- - **Card**: Container di contenuto con supporto header e azioni
173
- - **Main**: Area contenuto principale dell'applicazione con layout responsive
174
- - **Navbar**: Barra di navigazione superiore con supporto contenuto flessibile
175
- - **Sidebar**: Navigazione laterale collassabile
176
-
177
- ### Componenti General (22)
124
+ This provides:
125
+ - Interactive component previews
126
+ - Component API documentation
127
+ - Usage examples and code snippets
128
+ - Styling reference
178
129
 
179
- Elementi UI core per costruire interfacce:
130
+ ## Usage
180
131
 
181
- **Display & Feedback**
132
+ Using Better UI components in your views is straightforward:
182
133
 
183
- - **Alert**: Messaggi di notifica con temi multipli e opzioni dismissible
184
- - **Avatar**: Immagini profilo utente con supporto fallback
185
- - **Badge**: Indicatori di stato e etichette
186
- - **Progress**: Barre di progresso e indicatori di caricamento
187
- - **Spinner**: Animazioni di caricamento
188
- - **Tooltip**: Overlay di aiuto contestuale e informazioni
134
+ ```erb
135
+ <%# Basic button %>
136
+ <%= render BetterUi::General::ButtonComponent.new(label: 'Click me') %>
137
+
138
+ <%# Button with more options %>
139
+ <%= render BetterUi::General::ButtonComponent.new(
140
+ label: 'Submit',
141
+ variant: 'primary',
142
+ size: 'large',
143
+ icon_left: 'check',
144
+ data: { turbo: false }
145
+ ) %>
189
146
 
190
- **Navigazione & Struttura**
147
+ <%# Panel component %>
148
+ <%= render BetterUi::General::PanelComponent.new(title: 'User Details') do %>
149
+ <p>This is the panel content</p>
150
+ <% end %>
151
+ ```
191
152
 
192
- - **Breadcrumb**: Indicatori di percorso di navigazione
193
- - **Divider**: Separatori di contenuto visivi
194
- - **Heading**: Intestazioni con tipografia consistente
195
- - **Icon**: Sistema icone SVG con libreria estesa
196
- - **Link**: Elementi anchor potenziati con supporto theme
197
- - **Panel**: Sezioni di contenuto organizzate
198
- - **Table**: Tabelle dati con sorting e funzionalità responsive
199
- - **Tag**: Elementi di categorizzazione ed etichettatura
153
+ For more detailed usage instructions, see [USAGE.md](USAGE.md).
200
154
 
201
- **Form & Input**
155
+ ## Customization
202
156
 
203
- - **Button**: Button azione con varianti multiple e stati
204
- - **Field**: Wrapper campo form con supporto label e validazione
205
- - **Input**: Sistema input unificato che supporta 14+ tipi:
206
- - **Text**: text, email, password, search, url, tel
207
- - **Number**: number, range
208
- - **Date/Time**: date, datetime-local, time, month, week
209
- - **File**: upload file
210
- - **Color**: color picker
211
- - **Checkbox**: Opzioni multi-selezione
212
- - **Radio**: Opzioni selezione singola
213
- - **Select**: Selezioni dropdown
214
- - **Textarea**: Input testo multi-riga
157
+ Better UI is designed to be highly customizable:
215
158
 
216
- ### Componenti Form (0)
159
+ 1. **Style Customization**: Edit the generated override files in `app/assets/stylesheets/components/`
160
+ 2. **Component Configuration**: Configure default options in `config/initializers/better_ui.rb`
161
+ 3. **Component Extensions**: Extend existing components or create your own
217
162
 
218
- Riservati per futuri componenti form specializzati e widget form complessi.
163
+ Example of customizing a component style:
219
164
 
220
- ## Personalizzazione e Styling
165
+ ```scss
166
+ // app/assets/stylesheets/components/_button_overrides.scss
167
+ @layer components {
168
+ .bui-button {
169
+ &--primary {
170
+ @apply bg-indigo-600 hover:bg-indigo-700;
171
+ }
172
+ }
173
+ }
174
+ ```
221
175
 
222
- I componenti BetterUI usano classi Tailwind CSS. Puoi:
176
+ For more detailed customization instructions, see [CUSTOMIZATION.md](CUSTOMIZATION.md).
223
177
 
224
- 1. **Sovrascrivere classi**: Passa classi personalizzate tramite il parametro `classes`
225
- 2. **Estendere componenti**: Crea i tuoi componenti che ereditano da BetterUI
226
- 3. **Personalizzazione theme**: Modifica la configurazione Tailwind per tematizzazione consistente
178
+ ## Components
227
179
 
228
- ```erb
229
- <!-- Aggiungi classi personalizzate -->
230
- <%= render BetterUi::General::Button::Component.new(
231
- label: "Button Personalizzato",
232
- classes: "my-custom-class hover:scale-105"
233
- ) %>
234
- ```
180
+ Better UI includes a wide range of components categorized into:
235
181
 
236
- Better UI è progettato per essere altamente personalizzabile mantenendo consistenza:
182
+ - **General Components**: Basic UI elements like buttons, badges, icons
183
+ - **Application Components**: Complex UI elements like cards, alerts, sidebars
184
+ - **Website Components**: Components specifically designed for websites
237
185
 
238
- 1. **Personalizzazione Theme**: Modifica le costanti dei componenti per cambiare lo styling di default
239
- 2. **Configurazione Componenti**: Configura opzioni di default in `config/initializers/better_ui.rb`
240
- 3. **Integrazione TailwindCSS**: Tutto lo styling usa classi TailwindCSS per massima flessibilità
241
- 4. **Estensioni Componenti**: Estendi componenti esistenti o crea i tuoi seguendo i pattern stabiliti
186
+ For a full list of available components and their documentation, see [COMPONENTS.md](COMPONENTS.md).
242
187
 
243
188
  ## Testing
244
189
 
245
- I componenti Better UI sono testati completamente. Puoi eseguire la test suite con:
190
+ Better UI components are thoroughly tested. You can run the test suite with:
246
191
 
247
192
  ```bash
248
193
  bin/rails test
249
194
  ```
250
195
 
251
- ## Supporto Browser
252
-
253
- I componenti BetterUI supportano tutti i browser moderni che supportano:
254
-
255
- - CSS Grid e Flexbox
256
- - Funzionalità JavaScript ES6+
257
- - Tailwind CSS
196
+ For more detailed testing instructions, see [TESTING.md](TESTING.md).
258
197
 
259
198
  ## Contributing
260
199
 
261
- 1. Forka il repository
262
- 2. Crea il tuo branch feature (`git checkout -b feature/componente-fantastico`)
263
- 3. Aggiungi il tuo componente con test e preview Lookbook
264
- 4. Committa le tue modifiche (`git commit -am 'Aggiungi componente fantastico'`)
265
- 5. Pusha al branch (`git push origin feature/componente-fantastico`)
266
- 6. Crea una Pull Request
267
-
268
- ### Setup Development
269
-
270
- ```bash
271
- git clone https://github.com/alessiobussolari/better_ui.git
272
- cd better_ui
273
- bundle install
274
- cd test/dummy
275
- bundle exec rails server
276
- ```
277
-
278
- Visita `http://localhost:3000/lookbook` per vedere la documentazione dei componenti.
279
-
280
- ## Roadmap
281
-
282
- - 🎯 Componenti form avanzati (input complessi, validazioni)
283
- - 📊 Componenti chart e visualizzazione dati
284
- - 🎭 Componenti animazione e transizione
285
- - 🌙 Supporto dark mode
286
- - 📱 Componenti specifici mobile
287
- - 🔧 Tool di configurazione e generatori
200
+ Contributions are welcome! Please check out our [contribution guidelines](CONTRIBUTING.md).
288
201
 
289
202
  ## License
290
203
 
291
- La gem è disponibile come open source sotto i termini della [MIT License](https://opensource.org/licenses/MIT).
292
-
293
- ## Support
294
-
295
- - 📖 [Documentazione](https://github.com/alessiobussolari/better_ui)
296
- - 🐛 [Issue Tracker](https://github.com/alessiobussolari/better_ui/issues)
297
- - 💬 [Discussioni](https://github.com/alessiobussolari/better_ui/discussions)
204
+ Better UI is available as open source under the terms of the [MIT License](LICENSE).
298
205
 
299
- ---
206
+ ## Resources
300
207
 
301
- Costruito con ❤️ da [PanDev](https://github.com/alessiobussolari)
208
+ - [Troubleshooting Guide](TROUBLESHOOTING.md)
209
+ - [FAQs](FAQ.md)
210
+ - [Changelog](CHANGELOG.md)
211
+ - [Roadmap](ROADMAP.md)
@@ -0,0 +1,9 @@
1
+ // Base che importa Tailwind
2
+ @use "tailwindcss/base";
3
+ @use "tailwindcss/components";
4
+ @use "tailwindcss/utilities";
5
+
6
+ // Stili comuni dell'applicazione
7
+ html, body {
8
+ @apply font-sans text-gray-900 leading-normal;
9
+ }
@@ -0,0 +1,2 @@
1
+ // Re-espone tutti i componenti con un singolo import
2
+ @forward "components/index";
@@ -0,0 +1,14 @@
1
+ @layer utilities {
2
+ // Utility classes aggiuntive che estendono Tailwind
3
+ .spacing-responsive {
4
+ @apply px-4 py-6 md:px-6 md:py-8 lg:px-8 lg:py-10;
5
+ }
6
+
7
+ .text-shadow {
8
+ @apply shadow-sm;
9
+ }
10
+
11
+ .card-shadow {
12
+ @apply shadow-md hover:shadow-lg transition-shadow duration-200;
13
+ }
14
+ }
@@ -12,4 +12,36 @@
12
12
  *
13
13
  *= require_tree .
14
14
  *= require_self
15
+ *= require font-awesome
16
+ *= require better_ui
15
17
  */
18
+
19
+ /*
20
+ * BetterUI - Utilizziamo Tailwind CSS per tutti gli stili
21
+ * Ora organizzati con la moderna sintassi di Sass (@use/@forward)
22
+ */
23
+
24
+ /* Stili per il syntax highlighting di CodeRay */
25
+ .syntax-ruby {
26
+ color: #333;
27
+ background-color: #f8f8f8;
28
+ font-family: Monaco, Consolas, 'Courier New', monospace;
29
+ line-height: 1.5;
30
+ }
31
+ .syntax-ruby .keyword { color: #0066CC; font-weight: bold; }
32
+ .syntax-ruby .string, .syntax-ruby .string-content { color: #008800; }
33
+ .syntax-ruby .comment { color: #888888; font-style: italic; }
34
+ .syntax-ruby .constant { color: #CC0000; }
35
+ .syntax-ruby .class { color: #0086B3; font-weight: bold; }
36
+ .syntax-ruby .module { color: #0086B3; font-weight: bold; }
37
+ .syntax-ruby .symbol { color: #AA6600; }
38
+ .syntax-ruby .function { color: #990000; }
39
+ .syntax-ruby .regexp { color: #AA6600; }
40
+ .syntax-ruby .integer, .syntax-ruby .float { color: #0000DD; }
41
+ .syntax-ruby .global-variable, .syntax-ruby .instance-variable { color: #336699; }
42
+ .syntax-ruby .predefined { color: #3377BB; font-weight: bold; }
43
+ .syntax-ruby .error { color: #FF0000; background-color: #FFAAAA; }
44
+ .syntax-ruby .delimiter { color: #555555; }
45
+ .syntax-ruby .method { color: #990000; font-weight: bold; }
46
+ .syntax-ruby .attribute-name { color: #994500; }
47
+ .syntax-ruby .value { color: #0066CC; }