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.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +140 -230
- 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 +32 -0
- 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 +27 -0
- data/app/components/better_ui/application/alert_component.rb +202 -0
- 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/header_component.html.erb +88 -0
- data/app/components/better_ui/application/header_component.rb +188 -0
- data/app/components/better_ui/application/navbar_component.html.erb +294 -0
- data/app/components/better_ui/application/navbar_component.rb +249 -0
- data/app/components/better_ui/application/sidebar_component.html.erb +207 -0
- data/app/components/better_ui/application/sidebar_component.rb +318 -0
- data/app/components/better_ui/application/toast_component.html.erb +35 -0
- data/app/components/better_ui/application/toast_component.rb +223 -0
- 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 → badge_component.html.erb} +2 -6
- data/app/components/better_ui/general/badge_component.rb +135 -0
- data/app/components/better_ui/general/{breadcrumb/component.html.erb → breadcrumb_component.html.erb} +4 -4
- data/app/components/better_ui/general/breadcrumb_component.rb +130 -0
- data/app/components/better_ui/general/{button/component.html.erb → button_component.html.erb} +7 -7
- data/app/components/better_ui/general/button_component.rb +160 -0
- data/app/components/better_ui/general/heading_component.html.erb +1 -0
- data/app/components/better_ui/general/heading_component.rb +49 -0
- data/app/components/better_ui/general/icon_component.html.erb +2 -0
- data/app/components/better_ui/general/icon_component.rb +77 -0
- 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.html.erb +27 -0
- data/app/components/better_ui/general/panel_component.rb +92 -0
- 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 +73 -0
- data/app/components/better_ui/general/table_component.rb +143 -0
- data/app/controllers/better_ui/application_controller.rb +1 -0
- 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/app/views/layouts/component_preview.html.erb +32 -0
- data/config/initializers/lookbook.rb +12 -12
- data/config/routes.rb +2 -0
- data/lib/better_ui/engine.rb +92 -5
- data/lib/better_ui/version.rb +1 -1
- data/lib/better_ui.rb +32 -4
- 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 +178 -147
- data/app/components/better_ui/application/card/component.html.erb +0 -20
- data/app/components/better_ui/application/card/component.rb +0 -214
- data/app/components/better_ui/application/main/component.html.erb +0 -9
- data/app/components/better_ui/application/main/component.rb +0 -123
- data/app/components/better_ui/application/navbar/component.html.erb +0 -92
- data/app/components/better_ui/application/navbar/component.rb +0 -136
- data/app/components/better_ui/application/sidebar/component.html.erb +0 -227
- data/app/components/better_ui/application/sidebar/component.rb +0 -130
- data/app/components/better_ui/general/accordion/component.html.erb +0 -5
- data/app/components/better_ui/general/accordion/component.rb +0 -92
- data/app/components/better_ui/general/accordion/item_component.html.erb +0 -12
- data/app/components/better_ui/general/accordion/item_component.rb +0 -176
- data/app/components/better_ui/general/alert/component.html.erb +0 -32
- data/app/components/better_ui/general/alert/component.rb +0 -242
- data/app/components/better_ui/general/avatar/component.html.erb +0 -20
- data/app/components/better_ui/general/avatar/component.rb +0 -301
- data/app/components/better_ui/general/badge/component.rb +0 -248
- data/app/components/better_ui/general/breadcrumb/component.rb +0 -187
- data/app/components/better_ui/general/button/component.rb +0 -214
- data/app/components/better_ui/general/divider/component.html.erb +0 -10
- data/app/components/better_ui/general/divider/component.rb +0 -226
- data/app/components/better_ui/general/dropdown/component.html.erb +0 -25
- data/app/components/better_ui/general/dropdown/component.rb +0 -170
- data/app/components/better_ui/general/dropdown/divider_component.html.erb +0 -1
- data/app/components/better_ui/general/dropdown/divider_component.rb +0 -41
- data/app/components/better_ui/general/dropdown/item_component.html.erb +0 -6
- data/app/components/better_ui/general/dropdown/item_component.rb +0 -119
- data/app/components/better_ui/general/field/component.html.erb +0 -27
- data/app/components/better_ui/general/field/component.rb +0 -37
- data/app/components/better_ui/general/heading/component.html.erb +0 -22
- data/app/components/better_ui/general/heading/component.rb +0 -257
- data/app/components/better_ui/general/icon/component.html.erb +0 -7
- data/app/components/better_ui/general/icon/component.rb +0 -239
- data/app/components/better_ui/general/input/checkbox/component.html.erb +0 -5
- data/app/components/better_ui/general/input/checkbox/component.rb +0 -238
- data/app/components/better_ui/general/input/datetime/component.html.erb +0 -5
- data/app/components/better_ui/general/input/datetime/component.rb +0 -223
- data/app/components/better_ui/general/input/radio/component.html.erb +0 -5
- data/app/components/better_ui/general/input/radio/component.rb +0 -230
- data/app/components/better_ui/general/input/select/component.html.erb +0 -16
- data/app/components/better_ui/general/input/select/component.rb +0 -184
- data/app/components/better_ui/general/input/select/select_component.html.erb +0 -5
- data/app/components/better_ui/general/input/select/select_component.rb +0 -37
- data/app/components/better_ui/general/input/text/component.html.erb +0 -5
- data/app/components/better_ui/general/input/text/component.rb +0 -171
- data/app/components/better_ui/general/input/textarea/component.html.erb +0 -5
- data/app/components/better_ui/general/input/textarea/component.rb +0 -166
- data/app/components/better_ui/general/link/component.html.erb +0 -18
- data/app/components/better_ui/general/link/component.rb +0 -258
- data/app/components/better_ui/general/modal/component.html.erb +0 -5
- data/app/components/better_ui/general/modal/component.rb +0 -47
- data/app/components/better_ui/general/modal/modal_component.html.erb +0 -52
- data/app/components/better_ui/general/modal/modal_component.rb +0 -160
- data/app/components/better_ui/general/pagination/component.html.erb +0 -85
- data/app/components/better_ui/general/pagination/component.rb +0 -216
- data/app/components/better_ui/general/panel/component.html.erb +0 -28
- data/app/components/better_ui/general/panel/component.rb +0 -249
- data/app/components/better_ui/general/progress/component.html.erb +0 -11
- data/app/components/better_ui/general/progress/component.rb +0 -160
- data/app/components/better_ui/general/spinner/component.html.erb +0 -35
- data/app/components/better_ui/general/spinner/component.rb +0 -93
- data/app/components/better_ui/general/table/component.html.erb +0 -5
- data/app/components/better_ui/general/table/component.rb +0 -217
- data/app/components/better_ui/general/table/tbody_component.html.erb +0 -3
- data/app/components/better_ui/general/table/tbody_component.rb +0 -30
- data/app/components/better_ui/general/table/td_component.html.erb +0 -3
- data/app/components/better_ui/general/table/td_component.rb +0 -44
- data/app/components/better_ui/general/table/tfoot_component.html.erb +0 -3
- data/app/components/better_ui/general/table/tfoot_component.rb +0 -28
- data/app/components/better_ui/general/table/th_component.html.erb +0 -6
- data/app/components/better_ui/general/table/th_component.rb +0 -51
- data/app/components/better_ui/general/table/thead_component.html.erb +0 -3
- data/app/components/better_ui/general/table/thead_component.rb +0 -28
- data/app/components/better_ui/general/table/tr_component.html.erb +0 -3
- data/app/components/better_ui/general/table/tr_component.rb +0 -30
- data/app/components/better_ui/general/tabs/component.html.erb +0 -11
- data/app/components/better_ui/general/tabs/component.rb +0 -120
- data/app/components/better_ui/general/tabs/panel_component.html.erb +0 -3
- data/app/components/better_ui/general/tabs/panel_component.rb +0 -37
- data/app/components/better_ui/general/tabs/tab_component.html.erb +0 -13
- data/app/components/better_ui/general/tabs/tab_component.rb +0 -111
- data/app/components/better_ui/general/tag/component.html.erb +0 -3
- data/app/components/better_ui/general/tag/component.rb +0 -104
- data/app/components/better_ui/general/tooltip/component.html.erb +0 -7
- data/app/components/better_ui/general/tooltip/component.rb +0 -239
- data/app/helpers/better_ui/application/components/card/card_helper.rb +0 -96
- data/app/helpers/better_ui/application/components/card.rb +0 -11
- data/app/helpers/better_ui/application/components/main/main_helper.rb +0 -64
- data/app/helpers/better_ui/application/components/navbar/navbar_helper.rb +0 -77
- data/app/helpers/better_ui/application/components/sidebar/sidebar_helper.rb +0 -51
- data/app/helpers/better_ui/application_helper.rb +0 -55
- data/app/helpers/better_ui/general/components/accordion/accordion_helper.rb +0 -73
- data/app/helpers/better_ui/general/components/accordion.rb +0 -11
- data/app/helpers/better_ui/general/components/alert/alert_helper.rb +0 -57
- data/app/helpers/better_ui/general/components/avatar/avatar_helper.rb +0 -29
- data/app/helpers/better_ui/general/components/badge/badge_helper.rb +0 -53
- data/app/helpers/better_ui/general/components/breadcrumb/breadcrumb_helper.rb +0 -37
- data/app/helpers/better_ui/general/components/button/button_helper.rb +0 -65
- data/app/helpers/better_ui/general/components/container/container_helper.rb +0 -60
- data/app/helpers/better_ui/general/components/divider/divider_helper.rb +0 -63
- data/app/helpers/better_ui/general/components/dropdown/divider_helper.rb +0 -32
- data/app/helpers/better_ui/general/components/dropdown/dropdown_helper.rb +0 -79
- data/app/helpers/better_ui/general/components/dropdown/item_helper.rb +0 -62
- data/app/helpers/better_ui/general/components/field/field_helper.rb +0 -26
- data/app/helpers/better_ui/general/components/heading/heading_helper.rb +0 -72
- data/app/helpers/better_ui/general/components/icon/icon_helper.rb +0 -16
- data/app/helpers/better_ui/general/components/input/checkbox/checkbox_helper.rb +0 -81
- data/app/helpers/better_ui/general/components/input/datetime/datetime_helper.rb +0 -91
- data/app/helpers/better_ui/general/components/input/radio/radio_helper.rb +0 -79
- data/app/helpers/better_ui/general/components/input/radio_group/radio_group_helper.rb +0 -124
- data/app/helpers/better_ui/general/components/input/select/select_helper.rb +0 -70
- data/app/helpers/better_ui/general/components/input/text/text_helper.rb +0 -138
- data/app/helpers/better_ui/general/components/input/textarea/textarea_helper.rb +0 -73
- data/app/helpers/better_ui/general/components/link/link_helper.rb +0 -89
- data/app/helpers/better_ui/general/components/modal/modal_helper.rb +0 -85
- data/app/helpers/better_ui/general/components/modal.rb +0 -11
- data/app/helpers/better_ui/general/components/pagination/pagination_helper.rb +0 -82
- data/app/helpers/better_ui/general/components/panel/panel_helper.rb +0 -83
- data/app/helpers/better_ui/general/components/progress/progress_helper.rb +0 -53
- data/app/helpers/better_ui/general/components/spinner/spinner_helper.rb +0 -19
- data/app/helpers/better_ui/general/components/table/table_helper.rb +0 -53
- data/app/helpers/better_ui/general/components/table/tbody_helper.rb +0 -13
- data/app/helpers/better_ui/general/components/table/td_helper.rb +0 -19
- data/app/helpers/better_ui/general/components/table/tfoot_helper.rb +0 -13
- data/app/helpers/better_ui/general/components/table/th_helper.rb +0 -19
- data/app/helpers/better_ui/general/components/table/thead_helper.rb +0 -13
- data/app/helpers/better_ui/general/components/table/tr_helper.rb +0 -13
- data/app/helpers/better_ui/general/components/tabs/panel_helper.rb +0 -62
- data/app/helpers/better_ui/general/components/tabs/tab_helper.rb +0 -55
- data/app/helpers/better_ui/general/components/tabs/tabs_helper.rb +0 -95
- data/app/helpers/better_ui/general/components/tag/tag_helper.rb +0 -26
- data/app/helpers/better_ui/general/components/tooltip/tooltip_helper.rb +0 -60
- data/app/views/layouts/better_ui/application.html.erb +0 -17
- data/lib/better_ui/railtie.rb +0 -20
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/MIT-LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,301 +1,211 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Better UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/rb/better_ui)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
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
|
-
|
|
8
|
+

|
|
13
9
|
|
|
14
|
-
|
|
10
|
+
## Table of Contents
|
|
15
11
|
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
For more detailed information, see the [components documentation](COMPONENTS.md).
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
### Basic Installation
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
1. Add the gem to your Gemfile:
|
|
36
45
|
|
|
37
46
|
```ruby
|
|
38
|
-
gem
|
|
39
|
-
gem "lookbook", group: :development
|
|
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
|
-
|
|
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
|
-
```
|
|
55
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
+
### Advanced Installation Options
|
|
75
69
|
|
|
76
|
-
|
|
70
|
+
You can customize the installation process with the following options:
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
```bash
|
|
73
|
+
# Skip mounting the engine in routes
|
|
74
|
+
bin/rails generate better_ui:install --skip-routes
|
|
79
75
|
|
|
80
|
-
|
|
76
|
+
# Skip generating stylesheets
|
|
77
|
+
bin/rails generate better_ui:install --skip-stylesheets
|
|
81
78
|
|
|
82
|
-
|
|
79
|
+
# Skip creating the configuration file
|
|
80
|
+
bin/rails generate better_ui:install --skip-config
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
# All options together
|
|
83
|
+
bin/rails generate better_ui:install --skip-routes --skip-stylesheets --skip-config
|
|
84
|
+
```
|
|
85
85
|
|
|
86
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
111
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
Tutti i componenti supportano tematizzazione consistente:
|
|
114
|
+
For more detailed installation instructions, see [INSTALLATION.md](INSTALLATION.md).
|
|
140
115
|
|
|
141
|
-
|
|
142
|
-
- **3 Dimensioni Standard**: small, medium, large
|
|
143
|
-
- **5 Opzioni Border Radius**: none, small, medium, large, full
|
|
116
|
+
## Documentation
|
|
144
117
|
|
|
145
|
-
|
|
118
|
+
After installation, you can access the interactive documentation at:
|
|
146
119
|
|
|
147
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
130
|
+
## Usage
|
|
180
131
|
|
|
181
|
-
|
|
132
|
+
Using Better UI components in your views is straightforward:
|
|
182
133
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
155
|
+
## Customization
|
|
202
156
|
|
|
203
|
-
|
|
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
|
-
|
|
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
|
-
|
|
163
|
+
Example of customizing a component style:
|
|
219
164
|
|
|
220
|
-
|
|
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
|
-
|
|
176
|
+
For more detailed customization instructions, see [CUSTOMIZATION.md](CUSTOMIZATION.md).
|
|
223
177
|
|
|
224
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+
}
|
|
@@ -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; }
|