better_ui 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +141 -189
  3. data/app/assets/stylesheets/better_ui/_base.scss +9 -0
  4. data/app/assets/stylesheets/better_ui/_components.scss +2 -0
  5. data/app/assets/stylesheets/better_ui/_utilities.scss +14 -0
  6. data/app/assets/stylesheets/better_ui/application.css +3 -1
  7. data/app/assets/stylesheets/better_ui/components/_avatar.scss +200 -0
  8. data/app/assets/stylesheets/better_ui/components/_badge.scss +154 -0
  9. data/app/assets/stylesheets/better_ui/components/_breadcrumb.scss +106 -0
  10. data/app/assets/stylesheets/better_ui/components/_button.scss +105 -0
  11. data/app/assets/stylesheets/better_ui/components/_card.scss +60 -0
  12. data/app/assets/stylesheets/better_ui/components/_heading.scss +81 -0
  13. data/app/assets/stylesheets/better_ui/components/_icon.scss +134 -0
  14. data/app/assets/stylesheets/better_ui/components/_index.scss +17 -0
  15. data/app/assets/stylesheets/better_ui/components/_link.scss +100 -0
  16. data/app/assets/stylesheets/better_ui/components/_panel.scss +104 -0
  17. data/app/assets/stylesheets/better_ui/components/_spinner.scss +129 -0
  18. data/app/assets/stylesheets/better_ui/components/_table.scss +156 -0
  19. data/app/assets/stylesheets/better_ui/components/_variables.scss +1 -0
  20. data/app/assets/stylesheets/better_ui.scss +4 -0
  21. data/app/components/better_ui/application/alert_component.html.erb +1 -1
  22. data/app/components/better_ui/application/alert_component.rb +95 -89
  23. data/app/components/better_ui/application/card_component.html.erb +24 -0
  24. data/app/components/better_ui/application/card_component.rb +53 -0
  25. data/app/components/better_ui/application/card_container_component.html.erb +8 -0
  26. data/app/components/better_ui/application/card_container_component.rb +14 -0
  27. data/app/components/better_ui/application/toast_component.rb +92 -57
  28. data/app/components/better_ui/general/avatar_component.html.erb +19 -0
  29. data/app/components/better_ui/general/avatar_component.rb +171 -0
  30. data/app/components/better_ui/general/badge_component.html.erb +19 -0
  31. data/app/components/better_ui/general/badge_component.rb +135 -0
  32. data/app/components/better_ui/general/breadcrumb_component.html.erb +7 -31
  33. data/app/components/better_ui/general/breadcrumb_component.rb +64 -66
  34. data/app/components/better_ui/general/button_component.html.erb +6 -6
  35. data/app/components/better_ui/general/button_component.rb +62 -95
  36. data/app/components/better_ui/general/heading_component.html.erb +1 -25
  37. data/app/components/better_ui/general/heading_component.rb +20 -113
  38. data/app/components/better_ui/general/icon_component.rb +37 -61
  39. data/app/components/better_ui/general/link_component.html.erb +17 -0
  40. data/app/components/better_ui/general/link_component.rb +132 -0
  41. data/app/components/better_ui/general/panel_component.rb +51 -56
  42. data/app/components/better_ui/general/spinner_component.html.erb +15 -0
  43. data/app/components/better_ui/general/spinner_component.rb +79 -0
  44. data/app/components/better_ui/general/table_component.html.erb +56 -20
  45. data/app/components/better_ui/general/table_component.rb +89 -87
  46. data/app/helpers/better_ui/general/components/avatar_helper.rb +17 -0
  47. data/app/helpers/better_ui/general/components/badge_helper.rb +17 -0
  48. data/app/helpers/better_ui/general/components/breadcrumb_helper.rb +17 -0
  49. data/app/helpers/better_ui/general/components/button_helper.rb +17 -0
  50. data/app/helpers/better_ui/general/components/heading_helper.rb +17 -0
  51. data/app/helpers/better_ui/general/components/icon_helper.rb +17 -0
  52. data/app/helpers/better_ui/general/components/link_helper.rb +17 -0
  53. data/app/helpers/better_ui/general/components/panel_helper.rb +16 -0
  54. data/app/helpers/better_ui/general/components/spinner_helper.rb +17 -0
  55. data/app/helpers/better_ui/general/components/table_helper.rb +17 -0
  56. data/app/helpers/better_ui/general_helper.rb +15 -0
  57. data/app/helpers/better_ui_helper.rb +12 -0
  58. data/app/views/components/better_ui/general/table/_custom_body_row.html.erb +17 -0
  59. data/app/views/components/better_ui/general/table/_custom_footer_rows.html.erb +17 -0
  60. data/app/views/components/better_ui/general/table/_custom_header_rows.html.erb +12 -0
  61. data/config/routes.rb +2 -13
  62. data/lib/better_ui/engine.rb +66 -16
  63. data/lib/better_ui/version.rb +1 -1
  64. data/lib/better_ui.rb +12 -0
  65. data/lib/generators/better_ui/install_generator.rb +103 -0
  66. data/lib/generators/better_ui/stylesheet_generator.rb +159 -0
  67. data/lib/generators/better_ui/templates/README +125 -0
  68. data/lib/generators/better_ui/templates/components/_avatar.scss +200 -0
  69. data/lib/generators/better_ui/templates/components/_badge.scss +154 -0
  70. data/lib/generators/better_ui/templates/components/_breadcrumb.scss +106 -0
  71. data/lib/generators/better_ui/templates/components/_button.scss +109 -0
  72. data/lib/generators/better_ui/templates/components/_card.scss +60 -0
  73. data/lib/generators/better_ui/templates/components/_heading.scss +81 -0
  74. data/lib/generators/better_ui/templates/components/_icon.scss +134 -0
  75. data/lib/generators/better_ui/templates/components/_index.scss +17 -0
  76. data/lib/generators/better_ui/templates/components/_link.scss +100 -0
  77. data/lib/generators/better_ui/templates/components/_panel.scss +104 -0
  78. data/lib/generators/better_ui/templates/components/_spinner.scss +129 -0
  79. data/lib/generators/better_ui/templates/components/_table.scss +156 -0
  80. data/lib/generators/better_ui/templates/components/_variables.scss +0 -0
  81. data/lib/generators/better_ui/templates/components_stylesheet.scss +35 -0
  82. data/lib/generators/better_ui/templates/index.scss +18 -0
  83. data/lib/generators/better_ui/templates/initializer.rb +41 -0
  84. metadata +120 -49
  85. data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +0 -138
  86. data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +0 -211
  87. data/app/assets/javascripts/better_ui/controllers/toast_controller.js +0 -161
  88. data/app/assets/javascripts/better_ui/index.js +0 -159
  89. data/app/assets/javascripts/better_ui/toast_manager.js +0 -77
  90. data/app/components/better_ui/theme_helper.rb +0 -169
  91. data/app/controllers/better_ui/docs_controller.rb +0 -34
  92. data/app/helpers/better_ui_application_helper.rb +0 -99
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2242792aeee217a121cb73ec14ccc317d8f9c7af9e3dcdcf52629d05eca55731
4
- data.tar.gz: 86015104cb387605208eaa8f9ffbdeb3764542fd089e09cf2dd011cecc37640b
3
+ metadata.gz: ee8e6a1b636ddcd65276d5c410c5b0c9a239d236cdbf507d168bb68abe63c12d
4
+ data.tar.gz: 930f7752b6c813943b49d29bd635da5109355f036eea0bf1d5fc9aed45932173
5
5
  SHA512:
6
- metadata.gz: df1b73b3f9c3782a562ef7b585fd9bbac50c45fc8cc9661fe6ff8aa335c53f988c65ce4ab430c7c6dc82d74419b9dd80e026ad50c4533742b7940153fba2e653
7
- data.tar.gz: 1010406d6a425b0ca48e1acf0af262634a7f5babf54edd34dfd6c7b6943dbdb1a18c250d800f68b9e41ec7bc94d095a8ed9d3e3ca7efb540bbb3ddbe4d310105
6
+ metadata.gz: f91edcfb87541fbdeb97e2bc3899c1b1d3a8508bd94a6e6a9955ea56940830cfcc98df3e23f82e9bcb975039b6d3122c36f7c0e75316822ec11f03d206105647
7
+ data.tar.gz: 9422f6159176dc75cd254009f55660831aca51c98e7a4d829a5ab6b4911d5fc569f44ae05c549a452d5fd403a844a1b589642244c1922f485f59874094618921
data/README.md CHANGED
@@ -1,259 +1,211 @@
1
- # BetterUI 🎨
1
+ # Better UI
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/better_ui.svg)](https://badge.fury.io/rb/better_ui)
4
- [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- > Componenti UI eleganti, coerenti e facilmente integrabili per le tue applicazioni Rails
6
+ A comprehensive UI component library for Rails applications built with ViewComponent and Tailwind CSS, following BEM methodology.
7
7
 
8
- BetterUI è una gemma Rails che fornisce componenti UI riutilizzabili con documentazione integrata. Progettata per essere leggera, personalizzabile e facile da usare, ti aiuta a costruire interfacce belle e consistenti senza JavaScript.
8
+ ![Better UI Components](https://via.placeholder.com/800x400?text=Better+UI+Components)
9
9
 
10
- ## Caratteristiche principali
10
+ ## Table of Contents
11
11
 
12
- - **Design puro** - Componenti UI eleganti e completamente CSS, senza JavaScript
13
- - **Facile integrazione** - Engine Rails montabile che si integra perfettamente con la tua app
14
- - **Documentazione integrata** - Visualizza esempi e documentazione direttamente nel browser
15
- - **Altamente personalizzabile** - Adatta facilmente lo stile al tuo brand
16
- - **Componenti modulari** - Usa solo ciò di cui hai bisogno
17
- - **Preview dei componenti** - Visualizza e interagisci con i componenti usando Lookbook
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)
18
25
 
19
- ## 📦 Componenti disponibili
26
+ ## Overview
20
27
 
21
- | Componente | Descrizione |
22
- |------------|-------------|
23
- | **Button** | Pulsanti stilizzati con varianti primary, secondary, success, danger |
24
- | **Alert** | Messaggi informativi, successi, avvisi ed errori |
25
- | **Card** | Contenitori flessibili con header, body e footer |
26
- | **Modal** | Finestre di dialogo modali |
27
- | **Tabs** | Navigazione a schede |
28
- | **Navbar** | Barra di navigazione responsive con supporto per menu dropdown |
29
- | **Sidebar** | Menu laterale con supporto per navigazione gerarchica |
30
- | **Toast** | Notifiche temporanee con timer e animazioni |
31
- | **Header** | Intestazioni di pagina con titolo, sottotitolo, breadcrumb e azioni |
32
- | **Form Elements** | Campi di input stilizzati (in arrivo) |
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.
33
29
 
34
- ## 🚀 Installazione
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
35
37
 
36
- Aggiungi questa riga al Gemfile della tua applicazione:
38
+ For more detailed information, see the [components documentation](COMPONENTS.md).
39
+
40
+ ## Installation
41
+
42
+ ### Basic Installation
43
+
44
+ 1. Add the gem to your Gemfile:
37
45
 
38
46
  ```ruby
39
- gem 'better_ui', '~> 0.1.0'
47
+ gem 'better_ui'
40
48
  ```
41
49
 
42
- E poi esegui:
50
+ 2. Run bundle install:
43
51
 
44
52
  ```bash
45
- $ bundle install
53
+ bundle install
46
54
  ```
47
55
 
48
- ## ⚙️ Configurazione
56
+ 3. Run the installer:
49
57
 
50
- ### Monta l'engine
51
-
52
- Aggiungi questo al tuo file `config/routes.rb`:
53
-
54
- ```ruby
55
- Rails.application.routes.draw do
56
- mount BetterUi::Engine => '/better_ui'
57
-
58
- # ... altre tue route
59
- end
58
+ ```bash
59
+ bin/rails generate better_ui:install
60
60
  ```
61
61
 
62
- ### Includi gli assets
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/`
63
67
 
64
- In `app/assets/stylesheets/application.css`:
68
+ ### Advanced Installation Options
65
69
 
66
- ```css
67
- /*
68
- *= require better_ui/application
69
- */
70
- ```
70
+ You can customize the installation process with the following options:
71
71
 
72
- ## 🎮 Utilizzo
72
+ ```bash
73
+ # Skip mounting the engine in routes
74
+ bin/rails generate better_ui:install --skip-routes
73
75
 
74
- Una volta installato, puoi iniziare ad usare i componenti:
76
+ # Skip generating stylesheets
77
+ bin/rails generate better_ui:install --skip-stylesheets
75
78
 
76
- ```erb
77
- <%# Button %>
78
- <%= better_ui_button("Salva", type: "primary") %>
79
-
80
- <%# Alert %>
81
- <%= better_ui_alert("Operazione completata", type: "success") %>
82
-
83
- <%# Card %>
84
- <%= better_ui_card do %>
85
- <%= better_ui_card_header("Titolo Card") %>
86
- <%= better_ui_card_body do %>
87
- <p>Contenuto della card...</p>
88
- <% end %>
89
- <% end %>
79
+ # Skip creating the configuration file
80
+ bin/rails generate better_ui:install --skip-config
90
81
 
91
- <%# Header con breadcrumb %>
92
- <%= render BetterUi::Application::HeaderComponent.new(
93
- title: "Dashboard",
94
- subtitle: "Gestisci tutto da qui",
95
- breadcrumbs: [
96
- { text: "Home", url: "/" },
97
- { text: "Dashboard" }
98
- ],
99
- actions: [
100
- { content: button_html("Nuovo", "primary") }
101
- ]
102
- ) %>
82
+ # All options together
83
+ bin/rails generate better_ui:install --skip-routes --skip-stylesheets --skip-config
103
84
  ```
104
85
 
105
- Visita `/better_ui` nella tua applicazione per vedere la documentazione completa e gli esempi.
86
+ ### Tailwind CSS Configuration
106
87
 
107
- ### Il componente Header
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:
108
89
 
109
- Il componente Header è progettato per creare intestazioni di pagina complete con numerose funzionalità:
90
+ 1. Install Tailwind CSS in your Rails application:
110
91
 
111
- ```erb
112
- <%= render BetterUi::Application::HeaderComponent.new(
113
- title: {
114
- text: "Impostazioni",
115
- icon: "settings"
116
- },
117
- subtitle: "Configura le preferenze del sistema",
118
- breadcrumbs: [
119
- { text: "Home", url: "/" },
120
- { text: "Admin", url: "/admin" },
121
- { text: "Impostazioni" }
122
- ],
123
- variant: :modern,
124
- fixed: :top,
125
- show_breadcrumbs: true,
126
- actions: [
127
- { content: button_html("Salva", "primary") },
128
- { content: button_html("Annulla", "secondary") }
129
- ]
130
- ) %>
92
+ ```bash
93
+ bin/rails tailwindcss:install
131
94
  ```
132
95
 
133
- Il componente supporta:
134
- - Titolo con opzionale icona integrata
135
- - Sottotitolo descrittivo
136
- - Breadcrumbs completi con link di navigazione
137
- - Azioni contestuali (pulsanti, menu, ecc.)
138
- - Varianti di stile: modern, light, dark, primary, transparent
139
- - Posizionamento fisso (in alto o in basso)
140
- - Controllo della visibilità dei breadcrumb
141
-
142
- ### Preview dei componenti con Lookbook
143
-
144
- BetterUI integra [Lookbook](https://github.com/allmarkedup/lookbook) per visualizzare in anteprima i componenti UI:
96
+ 2. Configure Tailwind to include Better UI's components:
145
97
 
146
- 1. Accedi a `/better_ui/lookbook` nella tua applicazione per visualizzare il catalogo componenti
147
- 2. Esplora le varianti e le configurazioni disponibili per ogni componente
148
- 3. Visualizza il codice sorgente e il markup generato
149
- 4. Interagisci con i componenti in tempo reale
98
+ In your `tailwind.config.js` file, add:
150
99
 
151
- Lookbook è disponibile solo negli ambienti di sviluppo e test.
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
+ }
112
+ ```
152
113
 
153
- ## 🎮 Personalizzazione
114
+ For more detailed installation instructions, see [INSTALLATION.md](INSTALLATION.md).
154
115
 
155
- ### Usa l'inizializzatore
116
+ ## Documentation
156
117
 
157
- Crea un file `config/initializers/better_ui.rb`:
118
+ After installation, you can access the interactive documentation at:
158
119
 
159
- ```ruby
160
- BetterUi.configure do |config|
161
- config.button_defaults = {
162
- class: 'rounded-lg text-sm'
163
- }
164
-
165
- config.alert_defaults = {
166
- dismissible: true
167
- }
168
- end
169
120
  ```
170
-
171
- ### Personalizza gli stili
172
-
173
- Sovrascrivi gli stili CSS nel tuo foglio di stile:
174
-
175
- ```css
176
- .better-ui-button-primary {
177
- background-color: #8b5cf6; /* Viola personalizzato */
178
- border-color: #8b5cf6;
179
- }
121
+ http://localhost:3000/better_ui
180
122
  ```
181
123
 
182
- ## 🛠 Sviluppo
124
+ This provides:
125
+ - Interactive component previews
126
+ - Component API documentation
127
+ - Usage examples and code snippets
128
+ - Styling reference
183
129
 
184
- BetterUI utilizza una app dummy integrata per lo sviluppo e i test. Ecco come iniziare:
130
+ ## Usage
185
131
 
186
- ### Setup iniziale
132
+ Using Better UI components in your views is straightforward:
187
133
 
188
- ```bash
189
- # Clona il repository
190
- git clone https://github.com/alessiobussolari/better_ui.git
191
- cd better_ui
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
+ ) %>
192
146
 
193
- # Installa le dipendenze
194
- bin/setup
147
+ <%# Panel component %>
148
+ <%= render BetterUi::General::PanelComponent.new(title: 'User Details') do %>
149
+ <p>This is the panel content</p>
150
+ <% end %>
195
151
  ```
196
152
 
197
- ### Avvia l'applicazione di test
153
+ For more detailed usage instructions, see [USAGE.md](USAGE.md).
198
154
 
199
- Per vedere i componenti in azione e lavorare sulla documentazione:
155
+ ## Customization
200
156
 
201
- ```bash
202
- # Avvia il server di test
203
- cd test/dummy
204
- bin/rails server
157
+ Better UI is designed to be highly customizable:
158
+
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
205
162
 
206
- # Oppure dalla directory principale
207
- bin/rails server -b 0.0.0.0
163
+ Example of customizing a component style:
164
+
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
+ }
208
174
  ```
209
175
 
210
- Visita `http://localhost:3000/better_ui` nel tuo browser per vedere la documentazione e testare i componenti.
176
+ For more detailed customization instructions, see [CUSTOMIZATION.md](CUSTOMIZATION.md).
211
177
 
212
- ### Flusso di sviluppo
178
+ ## Components
213
179
 
214
- 1. **Crea un branch**: `git checkout -b feature/nuovo-componente`
215
- 2. **Implementa il componente**: Aggiungi helper in `app/helpers/better_ui/application_helper.rb`
216
- 3. **Aggiungi CSS**: Inserisci gli stili in `app/assets/stylesheets/better_ui/application.css`
217
- 4. **Documenta**: Crea file Markdown in `docs/components/`
218
- 5. **Testa**: Verifica nell'app dummy che tutto funzioni correttamente
219
- 6. **Esegui i test**: `rake test`
180
+ Better UI includes a wide range of components categorized into:
220
181
 
221
- ### Build e rilascio
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
222
185
 
223
- Per buildare la gemma localmente:
186
+ For a full list of available components and their documentation, see [COMPONENTS.md](COMPONENTS.md).
224
187
 
225
- ```bash
226
- bundle exec rake build
227
- ```
188
+ ## Testing
228
189
 
229
- Per installare la versione in sviluppo:
190
+ Better UI components are thoroughly tested. You can run the test suite with:
230
191
 
231
192
  ```bash
232
- bundle exec rake install
193
+ bin/rails test
233
194
  ```
234
195
 
235
- ## 🤝 Contribuire
236
-
237
- I contributi sono benvenuti e apprezzati! Ecco come puoi aiutare:
238
-
239
- 1. **Fork** il repository su GitHub
240
- 2. **Clona** il tuo fork: `git clone https://github.com/TUO-USERNAME/better_ui.git`
241
- 3. **Crea** un branch per la tua feature: `git checkout -b feature/incredibile-miglioramento`
242
- 4. **Committa** i tuoi cambiamenti: `git commit -am 'Aggiunge una funzionalità incredibile'`
243
- 5. **Pusha** al branch: `git push origin feature/incredibile-miglioramento`
244
- 6. Invia una **Pull Request**
196
+ For more detailed testing instructions, see [TESTING.md](TESTING.md).
245
197
 
246
- ### Linee guida
198
+ ## Contributing
247
199
 
248
- - Segui lo stile di codice esistente
249
- - Scrivi test per le nuove funzionalità
250
- - Aggiorna la documentazione
251
- - Crea componenti che funzionano senza JavaScript
200
+ Contributions are welcome! Please check out our [contribution guidelines](CONTRIBUTING.md).
252
201
 
253
- ## 📄 Licenza
202
+ ## License
254
203
 
255
- BetterUI è disponibile come open source sotto i termini della [Licenza MIT](https://opensource.org/licenses/MIT).
204
+ Better UI is available as open source under the terms of the [MIT License](LICENSE).
256
205
 
257
- ---
206
+ ## Resources
258
207
 
259
- Realizzato con ❤️ da [Alessio Bussolari](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
+ }
@@ -13,10 +13,12 @@
13
13
  *= require_tree .
14
14
  *= require_self
15
15
  *= require font-awesome
16
+ *= require better_ui
16
17
  */
17
18
 
18
19
  /*
19
- * BetterUI - Utilizziamo Tailwind CSS per tutti gli stili
20
+ * BetterUI - Utilizziamo Tailwind CSS per tutti gli stili
21
+ * Ora organizzati con la moderna sintassi di Sass (@use/@forward)
20
22
  */
21
23
 
22
24
  /* Stili per il syntax highlighting di CodeRay */
@@ -0,0 +1,200 @@
1
+ @layer components {
2
+ // Classe base per l'avatar (Block)
3
+ .bui-avatar {
4
+ @apply inline-flex items-center justify-center relative;
5
+
6
+ // Elements
7
+ &__image {
8
+ @apply object-cover;
9
+ }
10
+
11
+ &__placeholder {
12
+ @apply flex items-center justify-center font-medium text-white uppercase;
13
+ }
14
+
15
+ &__status {
16
+ @apply absolute bottom-0 right-0 block rounded-full ring-2 ring-white;
17
+
18
+ &--online {
19
+ @apply bg-green-400;
20
+ }
21
+
22
+ &--offline {
23
+ @apply bg-gray-400;
24
+ }
25
+
26
+ &--busy {
27
+ @apply bg-red-400;
28
+ }
29
+
30
+ &--away {
31
+ @apply bg-yellow-400;
32
+ }
33
+ }
34
+
35
+ &__presence {
36
+ @apply absolute block rounded-full ring-2 ring-white;
37
+ }
38
+
39
+ &__badge {
40
+ @apply absolute -top-1 -right-1 flex items-center justify-center;
41
+ }
42
+
43
+ // Modifiers (dimensioni)
44
+ &--xs {
45
+ @apply h-6 w-6;
46
+
47
+ .bui-avatar__placeholder {
48
+ @apply text-xs;
49
+ }
50
+
51
+ .bui-avatar__status {
52
+ @apply h-1.5 w-1.5;
53
+ }
54
+
55
+ .bui-avatar__badge {
56
+ @apply h-4 w-4 text-[0.6rem];
57
+ }
58
+ }
59
+
60
+ &--sm {
61
+ @apply h-8 w-8;
62
+
63
+ .bui-avatar__placeholder {
64
+ @apply text-xs;
65
+ }
66
+
67
+ .bui-avatar__status {
68
+ @apply h-2 w-2;
69
+ }
70
+
71
+ .bui-avatar__badge {
72
+ @apply h-5 w-5 text-xs;
73
+ }
74
+ }
75
+
76
+ &--md {
77
+ @apply h-10 w-10;
78
+
79
+ .bui-avatar__placeholder {
80
+ @apply text-sm;
81
+ }
82
+
83
+ .bui-avatar__status {
84
+ @apply h-2.5 w-2.5;
85
+ }
86
+
87
+ .bui-avatar__badge {
88
+ @apply h-6 w-6 text-xs;
89
+ }
90
+ }
91
+
92
+ &--lg {
93
+ @apply h-12 w-12;
94
+
95
+ .bui-avatar__placeholder {
96
+ @apply text-base;
97
+ }
98
+
99
+ .bui-avatar__status {
100
+ @apply h-3 w-3;
101
+ }
102
+
103
+ .bui-avatar__badge {
104
+ @apply h-7 w-7 text-sm;
105
+ }
106
+ }
107
+
108
+ &--xl {
109
+ @apply h-16 w-16;
110
+
111
+ .bui-avatar__placeholder {
112
+ @apply text-lg;
113
+ }
114
+
115
+ .bui-avatar__status {
116
+ @apply h-4 w-4;
117
+ }
118
+
119
+ .bui-avatar__badge {
120
+ @apply h-8 w-8 text-sm;
121
+ }
122
+ }
123
+
124
+ // Modifiers (colori placeholders)
125
+ &--gray {
126
+ .bui-avatar__placeholder {
127
+ @apply bg-gray-500;
128
+ }
129
+ }
130
+
131
+ &--red {
132
+ .bui-avatar__placeholder {
133
+ @apply bg-red-500;
134
+ }
135
+ }
136
+
137
+ &--blue {
138
+ .bui-avatar__placeholder {
139
+ @apply bg-blue-500;
140
+ }
141
+ }
142
+
143
+ &--green {
144
+ .bui-avatar__placeholder {
145
+ @apply bg-green-500;
146
+ }
147
+ }
148
+
149
+ &--violet {
150
+ .bui-avatar__placeholder {
151
+ @apply bg-violet-500;
152
+ }
153
+ }
154
+
155
+ &--orange {
156
+ .bui-avatar__placeholder {
157
+ @apply bg-orange-500;
158
+ }
159
+ }
160
+
161
+ &--yellow {
162
+ .bui-avatar__placeholder {
163
+ @apply bg-yellow-500 text-yellow-900;
164
+ }
165
+ }
166
+
167
+ // Modifiers (forma)
168
+ &--circle {
169
+ @apply rounded-full;
170
+
171
+ .bui-avatar__image,
172
+ .bui-avatar__placeholder {
173
+ @apply rounded-full;
174
+ }
175
+ }
176
+
177
+ &--square {
178
+ @apply rounded-md;
179
+
180
+ .bui-avatar__image,
181
+ .bui-avatar__placeholder {
182
+ @apply rounded-md;
183
+ }
184
+ }
185
+
186
+ // Modifiers (gruppo)
187
+ &--group {
188
+ @apply -ml-2 first:ml-0;
189
+ }
190
+ }
191
+
192
+ // Avatar group container
193
+ .bui-avatar-group {
194
+ @apply flex;
195
+
196
+ .bui-avatar {
197
+ @apply border-2 border-white;
198
+ }
199
+ }
200
+ }