better_ui 0.5.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 +137 -245
- 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/general/avatar_component.html.erb +2 -2
- data/app/components/better_ui/general/avatar_component.rb +29 -29
- data/app/components/better_ui/general/badge_component.html.erb +3 -3
- data/app/components/better_ui/general/badge_component.rb +32 -20
- data/app/components/better_ui/general/breadcrumb_component.html.erb +2 -2
- data/app/components/better_ui/general/breadcrumb_component.rb +23 -23
- data/app/components/better_ui/general/button_component.html.erb +6 -6
- data/app/components/better_ui/general/button_component.rb +20 -22
- data/app/components/better_ui/general/heading_component.html.erb +1 -25
- data/app/components/better_ui/general/heading_component.rb +17 -116
- data/app/components/better_ui/general/icon_component.html.erb +1 -1
- data/app/components/better_ui/general/icon_component.rb +33 -56
- data/app/components/better_ui/general/link_component.html.erb +4 -4
- data/app/components/better_ui/general/link_component.rb +28 -28
- data/app/components/better_ui/general/panel_component.rb +30 -41
- data/app/components/better_ui/general/spinner_component.html.erb +3 -3
- data/app/components/better_ui/general/spinner_component.rb +13 -13
- data/app/components/better_ui/general/table_component.rb +35 -59
- 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/config/routes.rb +2 -13
- data/lib/better_ui/engine.rb +67 -11
- data/lib/better_ui/version.rb +1 -1
- data/lib/better_ui.rb +10 -2
- data/lib/generators/better_ui/install_generator.rb +103 -0
- data/lib/generators/better_ui/stylesheet_generator.rb +93 -30
- data/lib/generators/better_ui/templates/README +74 -5
- data/lib/generators/better_ui/templates/components/_avatar.scss +199 -150
- data/lib/generators/better_ui/templates/components/_badge.scss +153 -141
- data/lib/generators/better_ui/templates/components/_breadcrumb.scss +105 -106
- data/lib/generators/better_ui/templates/components/_button.scss +104 -101
- data/lib/generators/better_ui/templates/components/_card.scss +56 -65
- data/lib/generators/better_ui/templates/components/_heading.scss +80 -179
- data/lib/generators/better_ui/templates/components/_icon.scss +133 -89
- data/lib/generators/better_ui/templates/components/_index.scss +17 -0
- data/lib/generators/better_ui/templates/components/_link.scss +99 -129
- data/lib/generators/better_ui/templates/components/_panel.scss +103 -143
- data/lib/generators/better_ui/templates/components/_spinner.scss +127 -130
- data/lib/generators/better_ui/templates/components/_table.scss +156 -105
- data/lib/generators/better_ui/templates/components/_variables.scss +0 -33
- data/lib/generators/better_ui/templates/components_stylesheet.scss +25 -56
- data/lib/generators/better_ui/templates/index.scss +18 -0
- data/lib/generators/better_ui/templates/initializer.rb +41 -0
- metadata +91 -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 -171
- data/app/controllers/better_ui/docs_controller.rb +0 -34
@@ -1,105 +1,156 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
.bui-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
.bui-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
.bui-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
.bui-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
.bui-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
.bui-
|
105
|
-
|
1
|
+
@layer components {
|
2
|
+
// Classe base per la tabella (Block)
|
3
|
+
.bui-table {
|
4
|
+
@apply w-full border-collapse;
|
5
|
+
|
6
|
+
// Elements
|
7
|
+
&__container {
|
8
|
+
@apply overflow-hidden border shadow-sm;
|
9
|
+
}
|
10
|
+
|
11
|
+
&__caption {
|
12
|
+
@apply p-4 font-medium text-left;
|
13
|
+
}
|
14
|
+
|
15
|
+
&__header {
|
16
|
+
@apply bg-gray-50;
|
17
|
+
}
|
18
|
+
|
19
|
+
&__footer {
|
20
|
+
@apply bg-gray-50;
|
21
|
+
}
|
22
|
+
|
23
|
+
&__body {
|
24
|
+
// Styling base per il corpo della tabella
|
25
|
+
}
|
26
|
+
|
27
|
+
&__cell {
|
28
|
+
@apply px-4 py-3 text-sm text-gray-700;
|
29
|
+
|
30
|
+
&--header {
|
31
|
+
@apply bg-gray-50 text-left text-xs uppercase tracking-wider text-gray-500 font-medium;
|
32
|
+
}
|
33
|
+
|
34
|
+
&--footer {
|
35
|
+
@apply font-medium;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
&__row {
|
40
|
+
@apply border-b border-gray-200;
|
41
|
+
}
|
42
|
+
|
43
|
+
// Modifiers (varianti)
|
44
|
+
&--default {
|
45
|
+
@apply bg-white text-gray-900 border-gray-200;
|
46
|
+
}
|
47
|
+
|
48
|
+
&--red {
|
49
|
+
@apply bg-red-50 text-red-900 border-red-200;
|
50
|
+
|
51
|
+
.bui-table__header {
|
52
|
+
@apply bg-red-100;
|
53
|
+
}
|
54
|
+
|
55
|
+
.bui-table__footer {
|
56
|
+
@apply bg-red-100;
|
57
|
+
}
|
58
|
+
|
59
|
+
.bui-table__cell--header {
|
60
|
+
@apply bg-red-100 text-red-800;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
&--blue {
|
65
|
+
@apply bg-blue-50 text-blue-900 border-blue-200;
|
66
|
+
|
67
|
+
.bui-table__header {
|
68
|
+
@apply bg-blue-100;
|
69
|
+
}
|
70
|
+
|
71
|
+
.bui-table__footer {
|
72
|
+
@apply bg-blue-100;
|
73
|
+
}
|
74
|
+
|
75
|
+
.bui-table__cell--header {
|
76
|
+
@apply bg-blue-100 text-blue-800;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
&--green {
|
81
|
+
@apply bg-green-50 text-green-900 border-green-200;
|
82
|
+
|
83
|
+
.bui-table__header {
|
84
|
+
@apply bg-green-100;
|
85
|
+
}
|
86
|
+
|
87
|
+
.bui-table__footer {
|
88
|
+
@apply bg-green-100;
|
89
|
+
}
|
90
|
+
|
91
|
+
.bui-table__cell--header {
|
92
|
+
@apply bg-green-100 text-green-800;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
// Stati tabella
|
97
|
+
&--striped {
|
98
|
+
.bui-table__row:nth-child(even) {
|
99
|
+
@apply bg-gray-50;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
&--hoverable {
|
104
|
+
.bui-table__row:hover {
|
105
|
+
@apply bg-gray-100;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
&--bordered {
|
110
|
+
@apply border;
|
111
|
+
|
112
|
+
.bui-table__cell {
|
113
|
+
@apply border;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
&--compact {
|
118
|
+
.bui-table__cell {
|
119
|
+
@apply px-2 py-1 text-xs;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
// Modifiers (border radius)
|
124
|
+
&--radius-none {
|
125
|
+
@apply rounded-none;
|
126
|
+
|
127
|
+
.bui-table__container {
|
128
|
+
@apply rounded-none;
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
&--radius-small {
|
133
|
+
@apply rounded-md;
|
134
|
+
|
135
|
+
.bui-table__container {
|
136
|
+
@apply rounded-md overflow-hidden;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
&--radius-medium {
|
141
|
+
@apply rounded-lg;
|
142
|
+
|
143
|
+
.bui-table__container {
|
144
|
+
@apply rounded-lg overflow-hidden;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
&--radius-large {
|
149
|
+
@apply rounded-xl;
|
150
|
+
|
151
|
+
.bui-table__container {
|
152
|
+
@apply rounded-xl overflow-hidden;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
/* ==============================
|
2
|
-
* Variables
|
3
|
-
* ============================== */
|
4
|
-
|
5
|
-
/* Colori principali - usa i colori di Tailwind */
|
6
|
-
$bui-primary: theme('colors.blue.500') !default;
|
7
|
-
$bui-primary-hover: theme('colors.blue.600') !default;
|
8
|
-
$bui-secondary: theme('colors.gray.500') !default;
|
9
|
-
$bui-secondary-hover: theme('colors.gray.600') !default;
|
10
|
-
$bui-success: theme('colors.emerald.500') !default;
|
11
|
-
$bui-warning: theme('colors.amber.500') !default;
|
12
|
-
$bui-danger: theme('colors.red.500') !default;
|
13
|
-
$bui-info: theme('colors.blue.500') !default;
|
14
|
-
|
15
|
-
/* Spaziature - usa gli spacing di Tailwind */
|
16
|
-
$bui-spacing-xs: theme('spacing.1') !default;
|
17
|
-
$bui-spacing-sm: theme('spacing.2') !default;
|
18
|
-
$bui-spacing-md: theme('spacing.4') !default;
|
19
|
-
$bui-spacing-lg: theme('spacing.6') !default;
|
20
|
-
$bui-spacing-xl: theme('spacing.8') !default;
|
21
|
-
|
22
|
-
/* Tipografia - usa i font di Tailwind */
|
23
|
-
$bui-font-family: theme('fontFamily.sans') !default;
|
24
|
-
$bui-font-size-sm: theme('fontSize.sm[0]') !default;
|
25
|
-
$bui-font-size-base: theme('fontSize.base[0]') !default;
|
26
|
-
$bui-font-size-lg: theme('fontSize.lg[0]') !default;
|
27
|
-
$bui-font-size-xl: theme('fontSize.xl[0]') !default;
|
28
|
-
|
29
|
-
/* Border radius - usa i radius di Tailwind */
|
30
|
-
$bui-radius-sm: theme('borderRadius.sm') !default;
|
31
|
-
$bui-radius-md: theme('borderRadius.md') !default;
|
32
|
-
$bui-radius-lg: theme('borderRadius.lg') !default;
|
33
|
-
$bui-radius-full: theme('borderRadius.full') !default;
|
@@ -1,66 +1,35 @@
|
|
1
1
|
/*
|
2
2
|
* <%= options[:prefix] %>_better_ui_components.scss
|
3
|
-
*
|
3
|
+
* ========================================================================
|
4
|
+
* File principale che utilizza il sistema moderno di moduli Sass
|
4
5
|
* Generato il: <%= Time.now.strftime('%d/%m/%Y %H:%M') %>
|
5
6
|
*/
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
/* Base Tailwind - importazioni fondamentali */
|
9
|
+
@use "tailwindcss/base";
|
10
|
+
@use "tailwindcss/components";
|
11
|
+
@use "tailwindcss/utilities";
|
12
|
+
|
13
|
+
/*
|
14
|
+
* Importa i componenti originali della gemma attraverso un namespace
|
15
|
+
* per evitare conflitti
|
13
16
|
*/
|
17
|
+
@use 'better_ui/components' as bui;
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@
|
19
|
+
/*
|
20
|
+
* Importa le personalizzazioni con namespace per organizzazione
|
21
|
+
* e chiarezza nel codice
|
22
|
+
*/
|
23
|
+
@use 'components/variables_overrides' as vars;
|
24
|
+
@use 'components/index' as overrides;
|
20
25
|
|
26
|
+
/*
|
27
|
+
* Aggiungi stili personalizzati dell'applicazione
|
28
|
+
* all'interno del layer components per mantenerli organizzati
|
29
|
+
*/
|
21
30
|
@layer components {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* Importa il componente Bottone */
|
27
|
-
@import "components/button";
|
28
|
-
|
29
|
-
/* Importa il componente Heading */
|
30
|
-
@import "components/heading";
|
31
|
-
|
32
|
-
/* Importa il componente Breadcrumb */
|
33
|
-
@import "components/breadcrumb";
|
34
|
-
|
35
|
-
/* Importa il componente Link */
|
36
|
-
@import "components/link";
|
37
|
-
|
38
|
-
/* Importa il componente Panel */
|
39
|
-
@import "components/panel";
|
40
|
-
|
41
|
-
/* Importa il componente Icon */
|
42
|
-
@import "components/icon";
|
43
|
-
|
44
|
-
/* Importa il componente Table */
|
45
|
-
@import "components/table";
|
46
|
-
|
47
|
-
/* Importa il componente Spinner */
|
48
|
-
@import "components/spinner";
|
49
|
-
|
50
|
-
/* Importa il componente Badge */
|
51
|
-
@import "components/badge";
|
52
|
-
|
53
|
-
/* Importa il componente Avatar */
|
54
|
-
@import "components/avatar";
|
55
|
-
|
56
|
-
/*==================================
|
57
|
-
COMPONENTI APPLICATIVI
|
58
|
-
====================================*/
|
59
|
-
/* Importa il componente Card */
|
60
|
-
@import "components/card";
|
61
|
-
|
62
|
-
/*==================================
|
63
|
-
PERSONALIZZAZIONI
|
64
|
-
====================================*/
|
65
|
-
/* Qui è possibile aggiungere personalizzazioni specifiche */
|
31
|
+
/*
|
32
|
+
* Qui puoi inserire stili personalizzati aggiuntivi
|
33
|
+
* che non rientrano nei file di override
|
34
|
+
*/
|
66
35
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/*
|
2
|
+
* components/_index.scss
|
3
|
+
* File indice che raccoglie e riespone tutti i moduli di override
|
4
|
+
* Utilizza @forward per mantenere le API originali accessibili
|
5
|
+
*/
|
6
|
+
|
7
|
+
@forward 'variables_overrides';
|
8
|
+
@forward 'button_overrides';
|
9
|
+
@forward 'heading_overrides';
|
10
|
+
@forward 'breadcrumb_overrides';
|
11
|
+
@forward 'link_overrides';
|
12
|
+
@forward 'panel_overrides';
|
13
|
+
@forward 'icon_overrides';
|
14
|
+
@forward 'table_overrides';
|
15
|
+
@forward 'badge_overrides';
|
16
|
+
@forward 'spinner_overrides';
|
17
|
+
@forward 'avatar_overrides';
|
18
|
+
@forward 'card_overrides';
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Configurazione di Better UI
|
4
|
+
# Questo file contiene le impostazioni predefinite per i componenti di Better UI.
|
5
|
+
# Puoi modificare queste impostazioni in base alle tue necessità.
|
6
|
+
|
7
|
+
BetterUi.configure do |config|
|
8
|
+
# Configurazione predefinita per i bottoni
|
9
|
+
# Queste impostazioni verranno applicate a tutti i bottoni a meno che non vengano sovrascritte
|
10
|
+
config.button_defaults = {
|
11
|
+
type: :default, # Tipo di bottone (:default, :white, :red, :green, ecc.)
|
12
|
+
size: :medium, # Dimensione del bottone (:small, :medium, :large)
|
13
|
+
rounded: :small, # Arrotondamento (:none, :small, :medium, :large, :full)
|
14
|
+
full_width: false, # Se il bottone deve occupare tutta la larghezza disponibile
|
15
|
+
disabled: false # Se il bottone è disabilitato di default
|
16
|
+
}
|
17
|
+
|
18
|
+
# Configurazione predefinita per gli alert
|
19
|
+
config.alert_defaults = {
|
20
|
+
theme: :default, # Tema dell'alert (:default, :success, :warning, :danger, :info)
|
21
|
+
dismissible: true, # Se l'alert può essere chiuso dall'utente
|
22
|
+
icon: true # Se mostrare l'icona associata al tema
|
23
|
+
}
|
24
|
+
|
25
|
+
# Configurazione predefinita per le card
|
26
|
+
config.card_defaults = {
|
27
|
+
theme: :default, # Tema della card (:default, :outline, :elevated)
|
28
|
+
padding: :medium, # Padding interno (:small, :medium, :large)
|
29
|
+
rounded: :medium, # Arrotondamento (:none, :small, :medium, :large)
|
30
|
+
shadow: :medium # Ombreggiatura (:none, :small, :medium, :large)
|
31
|
+
}
|
32
|
+
|
33
|
+
# Configurazione predefinita per i tab
|
34
|
+
config.tabs_defaults = {
|
35
|
+
theme: :default, # Tema dei tab (:default, :pills, :underline)
|
36
|
+
size: :medium, # Dimensione (:small, :medium, :large)
|
37
|
+
alignment: :left # Allineamento (:left, :center, :right, :justified)
|
38
|
+
}
|
39
|
+
|
40
|
+
# Puoi aggiungere altre configurazioni predefinite per i tuoi componenti qui
|
41
|
+
end
|