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.
- checksums.yaml +4 -4
- data/README.md +141 -189
- data/app/assets/stylesheets/better_ui/_base.scss +9 -0
- data/app/assets/stylesheets/better_ui/_components.scss +2 -0
- data/app/assets/stylesheets/better_ui/_utilities.scss +14 -0
- data/app/assets/stylesheets/better_ui/application.css +3 -1
- data/app/assets/stylesheets/better_ui/components/_avatar.scss +200 -0
- data/app/assets/stylesheets/better_ui/components/_badge.scss +154 -0
- data/app/assets/stylesheets/better_ui/components/_breadcrumb.scss +106 -0
- data/app/assets/stylesheets/better_ui/components/_button.scss +105 -0
- data/app/assets/stylesheets/better_ui/components/_card.scss +60 -0
- data/app/assets/stylesheets/better_ui/components/_heading.scss +81 -0
- data/app/assets/stylesheets/better_ui/components/_icon.scss +134 -0
- data/app/assets/stylesheets/better_ui/components/_index.scss +17 -0
- data/app/assets/stylesheets/better_ui/components/_link.scss +100 -0
- data/app/assets/stylesheets/better_ui/components/_panel.scss +104 -0
- data/app/assets/stylesheets/better_ui/components/_spinner.scss +129 -0
- data/app/assets/stylesheets/better_ui/components/_table.scss +156 -0
- data/app/assets/stylesheets/better_ui/components/_variables.scss +1 -0
- data/app/assets/stylesheets/better_ui.scss +4 -0
- data/app/components/better_ui/application/alert_component.html.erb +1 -1
- data/app/components/better_ui/application/alert_component.rb +95 -89
- data/app/components/better_ui/application/card_component.html.erb +24 -0
- data/app/components/better_ui/application/card_component.rb +53 -0
- data/app/components/better_ui/application/card_container_component.html.erb +8 -0
- data/app/components/better_ui/application/card_container_component.rb +14 -0
- data/app/components/better_ui/application/toast_component.rb +92 -57
- data/app/components/better_ui/general/avatar_component.html.erb +19 -0
- data/app/components/better_ui/general/avatar_component.rb +171 -0
- data/app/components/better_ui/general/badge_component.html.erb +19 -0
- data/app/components/better_ui/general/badge_component.rb +135 -0
- data/app/components/better_ui/general/breadcrumb_component.html.erb +7 -31
- data/app/components/better_ui/general/breadcrumb_component.rb +64 -66
- data/app/components/better_ui/general/button_component.html.erb +6 -6
- data/app/components/better_ui/general/button_component.rb +62 -95
- data/app/components/better_ui/general/heading_component.html.erb +1 -25
- data/app/components/better_ui/general/heading_component.rb +20 -113
- data/app/components/better_ui/general/icon_component.rb +37 -61
- data/app/components/better_ui/general/link_component.html.erb +17 -0
- data/app/components/better_ui/general/link_component.rb +132 -0
- data/app/components/better_ui/general/panel_component.rb +51 -56
- data/app/components/better_ui/general/spinner_component.html.erb +15 -0
- data/app/components/better_ui/general/spinner_component.rb +79 -0
- data/app/components/better_ui/general/table_component.html.erb +56 -20
- data/app/components/better_ui/general/table_component.rb +89 -87
- data/app/helpers/better_ui/general/components/avatar_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/badge_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/breadcrumb_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/button_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/heading_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/icon_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/link_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/panel_helper.rb +16 -0
- data/app/helpers/better_ui/general/components/spinner_helper.rb +17 -0
- data/app/helpers/better_ui/general/components/table_helper.rb +17 -0
- data/app/helpers/better_ui/general_helper.rb +15 -0
- data/app/helpers/better_ui_helper.rb +12 -0
- data/app/views/components/better_ui/general/table/_custom_body_row.html.erb +17 -0
- data/app/views/components/better_ui/general/table/_custom_footer_rows.html.erb +17 -0
- data/app/views/components/better_ui/general/table/_custom_header_rows.html.erb +12 -0
- data/config/routes.rb +2 -13
- data/lib/better_ui/engine.rb +66 -16
- data/lib/better_ui/version.rb +1 -1
- data/lib/better_ui.rb +12 -0
- data/lib/generators/better_ui/install_generator.rb +103 -0
- data/lib/generators/better_ui/stylesheet_generator.rb +159 -0
- data/lib/generators/better_ui/templates/README +125 -0
- data/lib/generators/better_ui/templates/components/_avatar.scss +200 -0
- data/lib/generators/better_ui/templates/components/_badge.scss +154 -0
- data/lib/generators/better_ui/templates/components/_breadcrumb.scss +106 -0
- data/lib/generators/better_ui/templates/components/_button.scss +109 -0
- data/lib/generators/better_ui/templates/components/_card.scss +60 -0
- data/lib/generators/better_ui/templates/components/_heading.scss +81 -0
- data/lib/generators/better_ui/templates/components/_icon.scss +134 -0
- data/lib/generators/better_ui/templates/components/_index.scss +17 -0
- data/lib/generators/better_ui/templates/components/_link.scss +100 -0
- data/lib/generators/better_ui/templates/components/_panel.scss +104 -0
- data/lib/generators/better_ui/templates/components/_spinner.scss +129 -0
- data/lib/generators/better_ui/templates/components/_table.scss +156 -0
- data/lib/generators/better_ui/templates/components/_variables.scss +0 -0
- data/lib/generators/better_ui/templates/components_stylesheet.scss +35 -0
- data/lib/generators/better_ui/templates/index.scss +18 -0
- data/lib/generators/better_ui/templates/initializer.rb +41 -0
- metadata +120 -49
- data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +0 -138
- data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +0 -211
- data/app/assets/javascripts/better_ui/controllers/toast_controller.js +0 -161
- data/app/assets/javascripts/better_ui/index.js +0 -159
- data/app/assets/javascripts/better_ui/toast_manager.js +0 -77
- data/app/components/better_ui/theme_helper.rb +0 -169
- data/app/controllers/better_ui/docs_controller.rb +0 -34
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee8e6a1b636ddcd65276d5c410c5b0c9a239d236cdbf507d168bb68abe63c12d
|
4
|
+
data.tar.gz: 930f7752b6c813943b49d29bd635da5109355f036eea0bf1d5fc9aed45932173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91edcfb87541fbdeb97e2bc3899c1b1d3a8508bd94a6e6a9955ea56940830cfcc98df3e23f82e9bcb975039b6d3122c36f7c0e75316822ec11f03d206105647
|
7
|
+
data.tar.gz: 9422f6159176dc75cd254009f55660831aca51c98e7a4d829a5ab6b4911d5fc569f44ae05c549a452d5fd403a844a1b589642244c1922f485f59874094618921
|
data/README.md
CHANGED
@@ -1,259 +1,211 @@
|
|
1
|
-
#
|
1
|
+
# Better UI
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/better_ui)
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
5
5
|
|
6
|
-
|
6
|
+
A comprehensive UI component library for Rails applications built with ViewComponent and Tailwind CSS, following BEM methodology.
|
7
7
|
|
8
|
-
|
8
|
+

|
9
9
|
|
10
|
-
##
|
10
|
+
## Table of Contents
|
11
11
|
|
12
|
-
-
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
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
|
-
##
|
26
|
+
## Overview
|
20
27
|
|
21
|
-
|
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
|
-
|
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
|
-
|
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'
|
47
|
+
gem 'better_ui'
|
40
48
|
```
|
41
49
|
|
42
|
-
|
50
|
+
2. Run bundle install:
|
43
51
|
|
44
52
|
```bash
|
45
|
-
|
53
|
+
bundle install
|
46
54
|
```
|
47
55
|
|
48
|
-
|
56
|
+
3. Run the installer:
|
49
57
|
|
50
|
-
|
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
|
-
|
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
|
-
|
68
|
+
### Advanced Installation Options
|
65
69
|
|
66
|
-
|
67
|
-
/*
|
68
|
-
*= require better_ui/application
|
69
|
-
*/
|
70
|
-
```
|
70
|
+
You can customize the installation process with the following options:
|
71
71
|
|
72
|
-
|
72
|
+
```bash
|
73
|
+
# Skip mounting the engine in routes
|
74
|
+
bin/rails generate better_ui:install --skip-routes
|
73
75
|
|
74
|
-
|
76
|
+
# Skip generating stylesheets
|
77
|
+
bin/rails generate better_ui:install --skip-stylesheets
|
75
78
|
|
76
|
-
|
77
|
-
|
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
|
-
|
92
|
-
|
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
|
-
|
86
|
+
### Tailwind CSS Configuration
|
106
87
|
|
107
|
-
|
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
|
-
|
90
|
+
1. Install Tailwind CSS in your Rails application:
|
110
91
|
|
111
|
-
```
|
112
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
114
|
+
For more detailed installation instructions, see [INSTALLATION.md](INSTALLATION.md).
|
154
115
|
|
155
|
-
|
116
|
+
## Documentation
|
156
117
|
|
157
|
-
|
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
|
-
|
124
|
+
This provides:
|
125
|
+
- Interactive component previews
|
126
|
+
- Component API documentation
|
127
|
+
- Usage examples and code snippets
|
128
|
+
- Styling reference
|
183
129
|
|
184
|
-
|
130
|
+
## Usage
|
185
131
|
|
186
|
-
|
132
|
+
Using Better UI components in your views is straightforward:
|
187
133
|
|
188
|
-
```
|
189
|
-
|
190
|
-
|
191
|
-
|
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
|
-
|
194
|
-
|
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
|
-
|
153
|
+
For more detailed usage instructions, see [USAGE.md](USAGE.md).
|
198
154
|
|
199
|
-
|
155
|
+
## Customization
|
200
156
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
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
|
-
|
207
|
-
|
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
|
-
|
176
|
+
For more detailed customization instructions, see [CUSTOMIZATION.md](CUSTOMIZATION.md).
|
211
177
|
|
212
|
-
|
178
|
+
## Components
|
213
179
|
|
214
|
-
|
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
|
-
|
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
|
-
|
186
|
+
For a full list of available components and their documentation, see [COMPONENTS.md](COMPONENTS.md).
|
224
187
|
|
225
|
-
|
226
|
-
bundle exec rake build
|
227
|
-
```
|
188
|
+
## Testing
|
228
189
|
|
229
|
-
|
190
|
+
Better UI components are thoroughly tested. You can run the test suite with:
|
230
191
|
|
231
192
|
```bash
|
232
|
-
|
193
|
+
bin/rails test
|
233
194
|
```
|
234
195
|
|
235
|
-
|
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
|
-
|
198
|
+
## Contributing
|
247
199
|
|
248
|
-
|
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
|
-
##
|
202
|
+
## License
|
254
203
|
|
255
|
-
|
204
|
+
Better UI is available as open source under the terms of the [MIT License](LICENSE).
|
256
205
|
|
257
|
-
|
206
|
+
## Resources
|
258
207
|
|
259
|
-
|
208
|
+
- [Troubleshooting Guide](TROUBLESHOOTING.md)
|
209
|
+
- [FAQs](FAQ.md)
|
210
|
+
- [Changelog](CHANGELOG.md)
|
211
|
+
- [Roadmap](ROADMAP.md)
|
@@ -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
|
+
}
|