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.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +137 -245
  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/general/avatar_component.html.erb +2 -2
  22. data/app/components/better_ui/general/avatar_component.rb +29 -29
  23. data/app/components/better_ui/general/badge_component.html.erb +3 -3
  24. data/app/components/better_ui/general/badge_component.rb +32 -20
  25. data/app/components/better_ui/general/breadcrumb_component.html.erb +2 -2
  26. data/app/components/better_ui/general/breadcrumb_component.rb +23 -23
  27. data/app/components/better_ui/general/button_component.html.erb +6 -6
  28. data/app/components/better_ui/general/button_component.rb +20 -22
  29. data/app/components/better_ui/general/heading_component.html.erb +1 -25
  30. data/app/components/better_ui/general/heading_component.rb +17 -116
  31. data/app/components/better_ui/general/icon_component.html.erb +1 -1
  32. data/app/components/better_ui/general/icon_component.rb +33 -56
  33. data/app/components/better_ui/general/link_component.html.erb +4 -4
  34. data/app/components/better_ui/general/link_component.rb +28 -28
  35. data/app/components/better_ui/general/panel_component.rb +30 -41
  36. data/app/components/better_ui/general/spinner_component.html.erb +3 -3
  37. data/app/components/better_ui/general/spinner_component.rb +13 -13
  38. data/app/components/better_ui/general/table_component.rb +35 -59
  39. data/app/helpers/better_ui/general/components/avatar_helper.rb +17 -0
  40. data/app/helpers/better_ui/general/components/badge_helper.rb +17 -0
  41. data/app/helpers/better_ui/general/components/breadcrumb_helper.rb +17 -0
  42. data/app/helpers/better_ui/general/components/button_helper.rb +17 -0
  43. data/app/helpers/better_ui/general/components/heading_helper.rb +17 -0
  44. data/app/helpers/better_ui/general/components/icon_helper.rb +17 -0
  45. data/app/helpers/better_ui/general/components/link_helper.rb +17 -0
  46. data/app/helpers/better_ui/general/components/panel_helper.rb +16 -0
  47. data/app/helpers/better_ui/general/components/spinner_helper.rb +17 -0
  48. data/app/helpers/better_ui/general/components/table_helper.rb +17 -0
  49. data/app/helpers/better_ui/general_helper.rb +15 -0
  50. data/app/helpers/better_ui_helper.rb +12 -0
  51. data/config/routes.rb +2 -13
  52. data/lib/better_ui/engine.rb +67 -11
  53. data/lib/better_ui/version.rb +1 -1
  54. data/lib/better_ui.rb +10 -2
  55. data/lib/generators/better_ui/install_generator.rb +103 -0
  56. data/lib/generators/better_ui/stylesheet_generator.rb +93 -30
  57. data/lib/generators/better_ui/templates/README +74 -5
  58. data/lib/generators/better_ui/templates/components/_avatar.scss +199 -150
  59. data/lib/generators/better_ui/templates/components/_badge.scss +153 -141
  60. data/lib/generators/better_ui/templates/components/_breadcrumb.scss +105 -106
  61. data/lib/generators/better_ui/templates/components/_button.scss +104 -101
  62. data/lib/generators/better_ui/templates/components/_card.scss +56 -65
  63. data/lib/generators/better_ui/templates/components/_heading.scss +80 -179
  64. data/lib/generators/better_ui/templates/components/_icon.scss +133 -89
  65. data/lib/generators/better_ui/templates/components/_index.scss +17 -0
  66. data/lib/generators/better_ui/templates/components/_link.scss +99 -129
  67. data/lib/generators/better_ui/templates/components/_panel.scss +103 -143
  68. data/lib/generators/better_ui/templates/components/_spinner.scss +127 -130
  69. data/lib/generators/better_ui/templates/components/_table.scss +156 -105
  70. data/lib/generators/better_ui/templates/components/_variables.scss +0 -33
  71. data/lib/generators/better_ui/templates/components_stylesheet.scss +25 -56
  72. data/lib/generators/better_ui/templates/index.scss +18 -0
  73. data/lib/generators/better_ui/templates/initializer.rb +41 -0
  74. metadata +91 -49
  75. data/app/assets/javascripts/better_ui/controllers/navbar_controller.js +0 -138
  76. data/app/assets/javascripts/better_ui/controllers/sidebar_controller.js +0 -211
  77. data/app/assets/javascripts/better_ui/controllers/toast_controller.js +0 -161
  78. data/app/assets/javascripts/better_ui/index.js +0 -159
  79. data/app/assets/javascripts/better_ui/toast_manager.js +0 -77
  80. data/app/components/better_ui/theme_helper.rb +0 -171
  81. data/app/controllers/better_ui/docs_controller.rb +0 -34
@@ -1,142 +1,154 @@
1
- /* ==============================
2
- * Badge Component
3
- * ============================== */
4
-
5
- /* Stile base */
6
- .bui-badge {
7
- @apply inline-flex items-center justify-center;
8
- @apply font-medium whitespace-nowrap;
9
- @apply transition-colors;
10
- }
11
-
12
- /* Posizionamento icone */
13
- .bui-badge-icon-left {
14
- @apply mr-1;
15
- }
16
-
17
- .bui-badge-icon-right {
18
- @apply ml-1;
19
- }
20
-
21
- /* Varianti di dimensione */
22
- .bui-badge-size-small {
23
- @apply py-0.5 px-1.5 text-xs;
24
- }
25
-
26
- .bui-badge-size-medium {
27
- @apply py-1 px-2 text-sm;
28
- }
29
-
30
- .bui-badge-size-large {
31
- @apply py-1.5 px-3 text-base;
32
- }
33
-
34
- /* Varianti di border-radius */
35
- .bui-badge-radius-none {
36
- @apply rounded-none;
37
- }
38
-
39
- .bui-badge-radius-small {
40
- @apply rounded;
41
- }
42
-
43
- .bui-badge-radius-medium {
44
- @apply rounded-md;
45
- }
46
-
47
- .bui-badge-radius-large {
48
- @apply rounded-lg;
49
- }
50
-
51
- .bui-badge-radius-full {
52
- @apply rounded-full;
53
- }
54
-
55
- /* Varianti stile */
56
- .bui-badge-outline {
57
- @apply bg-transparent border;
58
- }
59
-
60
- .bui-badge-notification {
61
- @apply absolute -top-1 -right-1 min-w-[1.25rem] h-5 py-0 px-1.5;
62
- @apply flex items-center justify-center text-xs;
63
- @apply rounded-full;
64
- }
65
-
66
- /* Varianti di colore - Standard */
67
- .bui-badge-default {
68
- @apply bg-gray-800 text-white;
69
- }
70
-
71
- .bui-badge-white {
72
- @apply bg-white text-gray-800 border border-gray-200;
73
- }
74
-
75
- .bui-badge-red {
76
- @apply bg-red-500 text-white;
77
- }
78
-
79
- .bui-badge-rose {
80
- @apply bg-rose-500 text-white;
81
- }
82
-
83
- .bui-badge-orange {
84
- @apply bg-orange-500 text-white;
85
- }
86
-
87
- .bui-badge-green {
88
- @apply bg-green-500 text-white;
89
- }
90
-
91
- .bui-badge-blue {
92
- @apply bg-blue-500 text-white;
93
- }
94
-
95
- .bui-badge-yellow {
96
- @apply bg-yellow-500 text-black;
97
- }
98
-
99
- .bui-badge-violet {
100
- @apply bg-violet-500 text-white;
101
- }
102
-
103
- .bui-badge-gray {
104
- @apply bg-gray-200 text-gray-800;
105
- }
106
-
107
- /* Varianti di colore - Outline */
108
- .bui-badge-outline.bui-badge-default {
109
- @apply border-gray-800 text-gray-800;
110
- }
111
-
112
- .bui-badge-outline.bui-badge-red {
113
- @apply border-red-500 text-red-600;
114
- }
115
-
116
- .bui-badge-outline.bui-badge-rose {
117
- @apply border-rose-500 text-rose-600;
118
- }
119
-
120
- .bui-badge-outline.bui-badge-orange {
121
- @apply border-orange-500 text-orange-600;
122
- }
123
-
124
- .bui-badge-outline.bui-badge-green {
125
- @apply border-green-500 text-green-600;
126
- }
127
-
128
- .bui-badge-outline.bui-badge-blue {
129
- @apply border-blue-500 text-blue-600;
130
- }
131
-
132
- .bui-badge-outline.bui-badge-yellow {
133
- @apply border-yellow-500 text-yellow-600;
134
- }
135
-
136
- .bui-badge-outline.bui-badge-violet {
137
- @apply border-violet-500 text-violet-600;
138
- }
139
-
140
- .bui-badge-outline.bui-badge-gray {
141
- @apply border-gray-300 text-gray-600;
1
+ @layer components {
2
+ // Classe base per il badge (Block)
3
+ .bui-badge {
4
+ @apply inline-flex items-center justify-center rounded-full px-2.5 py-0.5 text-xs font-medium;
5
+
6
+ // Elements
7
+ &__icon {
8
+ @apply flex-shrink-0;
9
+
10
+ &--left {
11
+ @apply -ml-0.5 mr-1.5;
12
+ }
13
+
14
+ &--right {
15
+ @apply -mr-0.5 ml-1.5;
16
+ }
17
+ }
18
+
19
+ &__text {
20
+ @apply whitespace-nowrap;
21
+ }
22
+
23
+ &__dot {
24
+ @apply h-2 w-2 rounded-full mr-1.5;
25
+ }
26
+
27
+ // Modifiers (varianti colore)
28
+ &--default {
29
+ @apply bg-gray-100 text-gray-800;
30
+
31
+ .bui-badge__dot {
32
+ @apply bg-gray-500;
33
+ }
34
+ }
35
+
36
+ &--white {
37
+ @apply bg-white text-gray-800 border border-gray-200;
38
+
39
+ .bui-badge__dot {
40
+ @apply bg-gray-400;
41
+ }
42
+ }
43
+
44
+ &--red {
45
+ @apply bg-red-100 text-red-800;
46
+
47
+ .bui-badge__dot {
48
+ @apply bg-red-500;
49
+ }
50
+ }
51
+
52
+ &--rose {
53
+ @apply bg-rose-100 text-rose-800;
54
+
55
+ .bui-badge__dot {
56
+ @apply bg-rose-500;
57
+ }
58
+ }
59
+
60
+ &--orange {
61
+ @apply bg-orange-100 text-orange-800;
62
+
63
+ .bui-badge__dot {
64
+ @apply bg-orange-500;
65
+ }
66
+ }
67
+
68
+ &--green {
69
+ @apply bg-green-100 text-green-800;
70
+
71
+ .bui-badge__dot {
72
+ @apply bg-green-500;
73
+ }
74
+ }
75
+
76
+ &--blue {
77
+ @apply bg-blue-100 text-blue-800;
78
+
79
+ .bui-badge__dot {
80
+ @apply bg-blue-500;
81
+ }
82
+ }
83
+
84
+ &--yellow {
85
+ @apply bg-yellow-100 text-yellow-800;
86
+
87
+ .bui-badge__dot {
88
+ @apply bg-yellow-500;
89
+ }
90
+ }
91
+
92
+ &--violet {
93
+ @apply bg-violet-100 text-violet-800;
94
+
95
+ .bui-badge__dot {
96
+ @apply bg-violet-500;
97
+ }
98
+ }
99
+
100
+ // Modifiers (varianti dimensione)
101
+ &--small {
102
+ @apply text-xs px-2 py-0.5;
103
+ }
104
+
105
+ &--medium {
106
+ @apply text-sm px-2.5 py-0.5;
107
+ }
108
+
109
+ &--large {
110
+ @apply text-sm px-3 py-1;
111
+ }
112
+
113
+ // Modifiers (varianti stile)
114
+ &--pill {
115
+ @apply rounded-full;
116
+ }
117
+
118
+ &--square {
119
+ @apply rounded-md;
120
+ }
121
+
122
+ &--outline {
123
+ @apply bg-transparent border;
124
+
125
+ &.bui-badge--red {
126
+ @apply border-red-500 text-red-700 bg-transparent;
127
+ }
128
+
129
+ &.bui-badge--green {
130
+ @apply border-green-500 text-green-700 bg-transparent;
131
+ }
132
+
133
+ &.bui-badge--blue {
134
+ @apply border-blue-500 text-blue-700 bg-transparent;
135
+ }
136
+
137
+ &.bui-badge--yellow {
138
+ @apply border-yellow-500 text-yellow-700 bg-transparent;
139
+ }
140
+
141
+ &.bui-badge--violet {
142
+ @apply border-violet-500 text-violet-700 bg-transparent;
143
+ }
144
+
145
+ &.bui-badge--orange {
146
+ @apply border-orange-500 text-orange-700 bg-transparent;
147
+ }
148
+
149
+ &.bui-badge--rose {
150
+ @apply border-rose-500 text-rose-700 bg-transparent;
151
+ }
152
+ }
153
+ }
142
154
  }
@@ -1,107 +1,106 @@
1
- /* ==============================
2
- * Breadcrumb Component
3
- * ============================== */
4
-
5
- /* Classi di base per il container e gli elementi */
6
- .bui-breadcrumb-container {
7
- @apply flex items-center flex-wrap;
8
- }
9
-
10
- .bui-breadcrumb-list {
11
- @apply flex flex-wrap items-center;
12
- }
13
-
14
- .bui-breadcrumb-item {
15
- @apply flex items-center;
16
- }
17
-
18
- .bui-breadcrumb-separator {
19
- @apply mx-2;
20
- }
21
-
22
- /* Dimensioni */
23
- .bui-breadcrumb-small {
24
- @apply text-xs;
25
- }
26
-
27
- .bui-breadcrumb-medium {
28
- @apply text-sm;
29
- }
30
-
31
- .bui-breadcrumb-large {
32
- @apply text-base;
33
- }
34
-
35
- /* Temi colore - Container */
36
- .bui-breadcrumb-default-container {
37
- @apply text-white;
38
- }
39
-
40
- .bui-breadcrumb-white-container {
41
- @apply text-black;
42
- }
43
-
44
- .bui-breadcrumb-red-container {
45
- @apply text-white;
46
- }
47
-
48
- .bui-breadcrumb-rose-container {
49
- @apply text-white;
50
- }
51
-
52
- .bui-breadcrumb-orange-container {
53
- @apply text-white;
54
- }
55
-
56
- .bui-breadcrumb-green-container {
57
- @apply text-white;
58
- }
59
-
60
- .bui-breadcrumb-blue-container {
61
- @apply text-white;
62
- }
63
-
64
- .bui-breadcrumb-yellow-container {
65
- @apply text-black;
66
- }
67
-
68
- .bui-breadcrumb-violet-container {
69
- @apply text-white;
70
- }
71
-
72
- /* Temi colore - Separatori */
73
- .bui-breadcrumb-default-separator {
74
- @apply text-gray-500;
75
- }
76
-
77
- .bui-breadcrumb-white-separator {
78
- @apply text-gray-400;
79
- }
80
-
81
- .bui-breadcrumb-red-separator {
82
- @apply text-red-300;
83
- }
84
-
85
- .bui-breadcrumb-rose-separator {
86
- @apply text-rose-300;
87
- }
88
-
89
- .bui-breadcrumb-orange-separator {
90
- @apply text-orange-300;
91
- }
92
-
93
- .bui-breadcrumb-green-separator {
94
- @apply text-green-300;
95
- }
96
-
97
- .bui-breadcrumb-blue-separator {
98
- @apply text-blue-300;
99
- }
100
-
101
- .bui-breadcrumb-yellow-separator {
102
- @apply text-yellow-600;
103
- }
104
-
105
- .bui-breadcrumb-violet-separator {
106
- @apply text-violet-300;
1
+ @layer components {
2
+ // Classe base per il breadcrumb (Block)
3
+ .bui-breadcrumb {
4
+ @apply flex items-center flex-wrap;
5
+
6
+ // Elements
7
+ &__list {
8
+ @apply flex flex-wrap items-center;
9
+ }
10
+
11
+ &__item {
12
+ @apply flex items-center;
13
+ }
14
+
15
+ &__separator {
16
+ @apply mx-2;
17
+
18
+ // Modifiers per il separatore
19
+ &--default {
20
+ @apply text-gray-500;
21
+ }
22
+
23
+ &--white {
24
+ @apply text-gray-400;
25
+ }
26
+
27
+ &--red {
28
+ @apply text-red-300;
29
+ }
30
+
31
+ &--rose {
32
+ @apply text-rose-300;
33
+ }
34
+
35
+ &--orange {
36
+ @apply text-orange-300;
37
+ }
38
+
39
+ &--green {
40
+ @apply text-green-300;
41
+ }
42
+
43
+ &--blue {
44
+ @apply text-blue-300;
45
+ }
46
+
47
+ &--yellow {
48
+ @apply text-yellow-600;
49
+ }
50
+
51
+ &--violet {
52
+ @apply text-violet-300;
53
+ }
54
+ }
55
+
56
+ // Modifiers (dimensioni)
57
+ &--small {
58
+ @apply text-xs;
59
+ }
60
+
61
+ &--medium {
62
+ @apply text-sm;
63
+ }
64
+
65
+ &--large {
66
+ @apply text-base;
67
+ }
68
+
69
+ // Modifiers (temi colore)
70
+ &--default {
71
+ @apply text-white;
72
+ }
73
+
74
+ &--white {
75
+ @apply text-black;
76
+ }
77
+
78
+ &--red {
79
+ @apply text-white;
80
+ }
81
+
82
+ &--rose {
83
+ @apply text-white;
84
+ }
85
+
86
+ &--orange {
87
+ @apply text-white;
88
+ }
89
+
90
+ &--green {
91
+ @apply text-white;
92
+ }
93
+
94
+ &--blue {
95
+ @apply text-white;
96
+ }
97
+
98
+ &--yellow {
99
+ @apply text-black;
100
+ }
101
+
102
+ &--violet {
103
+ @apply text-white;
104
+ }
105
+ }
107
106
  }