maquina-components 0.5.0 → 0.6.0
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 +79 -3
- data/app/assets/stylesheets/alert.css +169 -135
- data/app/assets/stylesheets/badge.css +143 -138
- data/app/assets/stylesheets/breadcrumbs.css +185 -147
- data/app/assets/stylesheets/calendar.css +219 -206
- data/app/assets/stylesheets/card.css +126 -120
- data/app/assets/stylesheets/combobox.css +215 -163
- data/app/assets/stylesheets/date_picker.css +144 -134
- data/app/assets/stylesheets/drawer.css +166 -118
- data/app/assets/stylesheets/dropdown_menu.css +203 -190
- data/app/assets/stylesheets/empty.css +125 -117
- data/app/assets/stylesheets/form.css +625 -525
- data/app/assets/stylesheets/header.css +63 -47
- data/app/assets/stylesheets/menu_button.css +178 -0
- data/app/assets/stylesheets/pagination.css +130 -125
- data/app/assets/stylesheets/separator.css +32 -0
- data/app/assets/stylesheets/sidebar.css +448 -390
- data/app/assets/stylesheets/stats.css +111 -0
- data/app/assets/stylesheets/table.css +184 -166
- data/app/assets/stylesheets/toast.css +287 -278
- data/app/assets/stylesheets/toggle_group.css +132 -139
- data/app/assets/tailwind/maquina_components_engine/engine.css +54 -12
- data/app/assets/tailwind/maquina_components_engine/tokens.css +101 -0
- data/app/helpers/maquina_components/combobox_helper.rb +34 -25
- data/app/helpers/maquina_components/components_helper.rb +57 -0
- data/app/helpers/maquina_components/dropdown_menu_helper.rb +12 -12
- data/app/helpers/maquina_components/icons_helper.rb +84 -2
- data/app/javascript/controllers/breadcrumb_controller.js +39 -30
- data/app/javascript/controllers/combobox_controller.js +9 -0
- data/app/javascript/controllers/drawer_controller.js +43 -9
- data/app/javascript/controllers/drawer_trigger_controller.js +55 -4
- data/app/javascript/controllers/menu_button_controller.js +107 -29
- data/app/javascript/controllers/sidebar_controller.js +6 -8
- data/app/javascript/controllers/sidebar_trigger_controller.js +33 -4
- data/app/javascript/controllers/toaster_controller.js +12 -0
- data/app/views/components/_alert.html.erb +3 -1
- data/app/views/components/_badge.html.erb +7 -1
- data/app/views/components/_breadcrumbs.html.erb +1 -1
- data/app/views/components/_calendar.html.erb +1 -1
- data/app/views/components/_card.html.erb +1 -1
- data/app/views/components/_combobox.html.erb +3 -2
- data/app/views/components/_date_picker.html.erb +4 -3
- data/app/views/components/_drawer.html.erb +8 -2
- data/app/views/components/_dropdown.html.erb +21 -24
- data/app/views/components/_dropdown_menu.html.erb +1 -1
- data/app/views/components/_empty.html.erb +1 -1
- data/app/views/components/_header.html.erb +1 -1
- data/app/views/components/_label.html.erb +14 -0
- data/app/views/components/_menu_button.html.erb +29 -34
- data/app/views/components/_pagination.html.erb +1 -1
- data/app/views/components/_separator.html.erb +9 -10
- data/app/views/components/_sidebar.html.erb +1 -1
- data/app/views/components/_simple_table.html.erb +3 -1
- data/app/views/components/_table.html.erb +3 -3
- data/app/views/components/_toast.html.erb +6 -1
- data/app/views/components/_toaster.html.erb +1 -1
- data/app/views/components/_toggle_group.html.erb +1 -1
- data/app/views/components/alert/_description.html.erb +1 -1
- data/app/views/components/alert/_title.html.erb +1 -1
- data/app/views/components/breadcrumbs/_ellipsis.html.erb +1 -1
- data/app/views/components/breadcrumbs/_item.html.erb +1 -1
- data/app/views/components/breadcrumbs/_link.html.erb +1 -1
- data/app/views/components/breadcrumbs/_list.html.erb +1 -1
- data/app/views/components/breadcrumbs/_page.html.erb +1 -1
- data/app/views/components/breadcrumbs/_separator.html.erb +1 -1
- data/app/views/components/calendar/_header.html.erb +1 -1
- data/app/views/components/calendar/_week.html.erb +5 -13
- data/app/views/components/card/_action.html.erb +1 -1
- data/app/views/components/card/_content.html.erb +1 -1
- data/app/views/components/card/_description.html.erb +1 -1
- data/app/views/components/card/_footer.html.erb +1 -1
- data/app/views/components/card/_header.html.erb +1 -1
- data/app/views/components/card/_title.html.erb +1 -1
- data/app/views/components/combobox/_content.html.erb +1 -1
- data/app/views/components/combobox/_empty.html.erb +3 -3
- data/app/views/components/combobox/_group.html.erb +1 -1
- data/app/views/components/combobox/_input.html.erb +1 -1
- data/app/views/components/combobox/_label.html.erb +1 -1
- data/app/views/components/combobox/_list.html.erb +1 -1
- data/app/views/components/combobox/_option.html.erb +1 -1
- data/app/views/components/combobox/_separator.html.erb +1 -1
- data/app/views/components/combobox/_trigger.html.erb +1 -1
- data/app/views/components/drawer/_close.html.erb +2 -2
- data/app/views/components/drawer/_content.html.erb +1 -1
- data/app/views/components/drawer/_description.html.erb +6 -0
- data/app/views/components/drawer/_footer.html.erb +1 -1
- data/app/views/components/drawer/_header.html.erb +3 -3
- data/app/views/components/drawer/_provider.html.erb +14 -5
- data/app/views/components/drawer/_section.html.erb +7 -0
- data/app/views/components/drawer/_separator.html.erb +11 -0
- data/app/views/components/drawer/_title.html.erb +6 -0
- data/app/views/components/drawer/_trigger.html.erb +24 -7
- data/app/views/components/dropdown_menu/_content.html.erb +1 -1
- data/app/views/components/dropdown_menu/_group.html.erb +1 -1
- data/app/views/components/dropdown_menu/_item.html.erb +1 -1
- data/app/views/components/dropdown_menu/_label.html.erb +3 -7
- data/app/views/components/dropdown_menu/_separator.html.erb +1 -1
- data/app/views/components/dropdown_menu/_shortcut.html.erb +3 -7
- data/app/views/components/dropdown_menu/_trigger.html.erb +1 -1
- data/app/views/components/empty/_content.html.erb +1 -1
- data/app/views/components/empty/_description.html.erb +3 -7
- data/app/views/components/empty/_header.html.erb +1 -1
- data/app/views/components/empty/_media.html.erb +5 -3
- data/app/views/components/empty/_title.html.erb +3 -7
- data/app/views/components/pagination/_content.html.erb +1 -1
- data/app/views/components/pagination/_item.html.erb +1 -1
- data/app/views/components/pagination/_link.html.erb +1 -1
- data/app/views/components/pagination/_next.html.erb +1 -1
- data/app/views/components/pagination/_previous.html.erb +1 -1
- data/app/views/components/sidebar/_content.html.erb +1 -1
- data/app/views/components/sidebar/_footer.html.erb +1 -1
- data/app/views/components/sidebar/_group.html.erb +1 -1
- data/app/views/components/sidebar/_group_action.html.erb +26 -0
- data/app/views/components/sidebar/_header.html.erb +1 -1
- data/app/views/components/sidebar/_inset.html.erb +1 -1
- data/app/views/components/sidebar/_menu.html.erb +1 -1
- data/app/views/components/sidebar/_menu_action.html.erb +28 -0
- data/app/views/components/sidebar/_menu_badge.html.erb +10 -0
- data/app/views/components/sidebar/_menu_button.html.erb +4 -3
- data/app/views/components/sidebar/_menu_item.html.erb +1 -1
- data/app/views/components/sidebar/_menu_link.html.erb +7 -9
- data/app/views/components/sidebar/_provider.html.erb +1 -1
- data/app/views/components/sidebar/_separator.html.erb +12 -0
- data/app/views/components/sidebar/_trigger.html.erb +1 -1
- data/app/views/components/stats/_stats_card.html.erb +32 -92
- data/app/views/components/stats/_stats_grid.html.erb +18 -24
- data/app/views/components/table/_body.html.erb +1 -1
- data/app/views/components/table/_caption.html.erb +3 -3
- data/app/views/components/table/_cell.html.erb +3 -3
- data/app/views/components/table/_footer.html.erb +1 -1
- data/app/views/components/table/_head.html.erb +3 -3
- data/app/views/components/table/_header.html.erb +1 -1
- data/app/views/components/table/_row.html.erb +1 -1
- data/app/views/components/toast/_action.html.erb +1 -1
- data/app/views/components/toast/_description.html.erb +1 -1
- data/app/views/components/toast/_title.html.erb +1 -1
- data/app/views/components/toggle_group/_item.html.erb +1 -1
- data/lib/generators/maquina_components/install/install_generator.rb +36 -1
- data/lib/generators/maquina_components/install/templates/maquina_components_helper.rb.tt +6 -0
- data/lib/generators/maquina_components/install/templates/shape_state_tokens.css.tt +76 -0
- data/lib/generators/maquina_components/install/templates/theme.css.tt +10 -3
- data/lib/maquina-components.rb +34 -1
- data/lib/maquina_components/doctor.rb +280 -0
- data/lib/maquina_components/engine.rb +7 -3
- data/lib/maquina_components/version.rb +1 -1
- data/lib/tasks/maquina_components_tasks.rake +16 -4
- metadata +46 -3
- data/app/assets/stylesheets/maquina_components.css +0 -178
|
@@ -11,123 +11,131 @@
|
|
|
11
11
|
* - title (heading)
|
|
12
12
|
* - description (explanatory text)
|
|
13
13
|
* - content (action buttons/links)
|
|
14
|
+
*
|
|
15
|
+
* Cascade order in this file (full contract documented in form.css):
|
|
16
|
+
* 1. base [data-component="empty"], [data-empty-part="…"]
|
|
17
|
+
* 2. sizes […]:where([data-size="compact"])
|
|
18
|
+
* 3. variants […]:where([data-variant="…"])
|
|
19
|
+
* 4. states […]:where(:hover)
|
|
20
|
+
* 5. dark — none; dark-mode differences are tokens (see tokens.css)
|
|
21
|
+
* Every rule is flattened to 0,1,0 with :where() and lives in
|
|
22
|
+
* @layer components, so a caller's utility class wins and source order is
|
|
23
|
+
* the only tie-breaker. (Rules whose target is a bare element read 0,1,1 — an
|
|
24
|
+
* element selector cannot be zeroed away.)
|
|
14
25
|
*/
|
|
15
26
|
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
27
|
+
@layer components {
|
|
28
|
+
/* ===== Root Container ===== */
|
|
29
|
+
[data-component="empty"] {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
text-align: center;
|
|
35
|
+
@apply px-6 py-12;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ===== Size Variants ===== */
|
|
39
|
+
[data-component="empty"]:where([data-size="compact"]) {
|
|
40
|
+
@apply px-6 py-8;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ===== Visual Variants ===== */
|
|
44
|
+
[data-component="empty"]:where([data-variant="default"]) {
|
|
45
|
+
/* No additional styles for default */
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-component="empty"]:where([data-variant="outline"]) {
|
|
49
|
+
border-radius: var(--empty-radius, var(--surface-radius, 0.5rem));
|
|
50
|
+
border: 1px dashed var(--border);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ===== Header ===== */
|
|
54
|
+
[data-empty-part="header"] {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: center;
|
|
58
|
+
@apply gap-2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ===== Media (Icon/Avatar Container) ===== */
|
|
62
|
+
[data-empty-part="media"] {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
color: var(--muted-foreground);
|
|
67
|
+
@apply mb-2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Icon variant */
|
|
71
|
+
[data-empty-part="media"]:where([data-variant="icon"]) {
|
|
72
|
+
@apply opacity-60;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-empty-part="media"]:where([data-variant="icon"]) svg {
|
|
76
|
+
@apply size-12;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Compact size adjustments */
|
|
80
|
+
:where([data-component="empty"][data-size="compact"]) [data-empty-part="media"]:where([data-variant="icon"]) svg {
|
|
81
|
+
@apply size-8;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Avatar variant */
|
|
85
|
+
[data-empty-part="media"]:where([data-variant="avatar"]) {
|
|
86
|
+
@apply size-16 overflow-hidden;
|
|
87
|
+
border-radius: var(--pill-radius, calc(infinity * 1px));
|
|
88
|
+
background-color: var(--muted);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-empty-part="media"]:where([data-variant="avatar"]) img {
|
|
92
|
+
@apply size-full object-cover;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* ===== Title ===== */
|
|
96
|
+
[data-empty-part="title"] {
|
|
97
|
+
color: var(--foreground);
|
|
98
|
+
@apply text-base;
|
|
99
|
+
font-weight: var(--label-weight, 500);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Compact size */
|
|
103
|
+
:where([data-component="empty"][data-size="compact"]) [data-empty-part="title"] {
|
|
104
|
+
@apply text-sm;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* ===== Description ===== */
|
|
108
|
+
[data-empty-part="description"] {
|
|
109
|
+
color: var(--muted-foreground);
|
|
110
|
+
@apply text-sm mt-1 max-w-md;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* Links in description */
|
|
114
|
+
[data-empty-part="description"] a {
|
|
115
|
+
color: var(--primary);
|
|
116
|
+
text-decoration: underline;
|
|
117
|
+
text-underline-offset: 4px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-empty-part="description"] a:where(:hover) {
|
|
121
|
+
@apply opacity-80;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* ===== Content (Actions) ===== */
|
|
125
|
+
[data-empty-part="content"] {
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
align-items: center;
|
|
129
|
+
@apply mt-6 gap-3;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Compact size */
|
|
133
|
+
:where([data-component="empty"][data-size="compact"]) [data-empty-part="content"] {
|
|
134
|
+
@apply mt-4;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Flex container for multiple buttons */
|
|
138
|
+
:where([data-empty-part="content"]) > .flex {
|
|
139
|
+
@apply gap-2;
|
|
140
|
+
}
|
|
121
141
|
}
|
|
122
|
-
|
|
123
|
-
/* Flex container for multiple buttons */
|
|
124
|
-
[data-empty-part="content"] > .flex {
|
|
125
|
-
@apply gap-2;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/* ===== Dark Mode ===== */
|
|
129
|
-
/*
|
|
130
|
-
* Dark mode is handled automatically through CSS variables.
|
|
131
|
-
* The theme variables change based on the .dark class on html/body.
|
|
132
|
-
* No additional dark mode styles needed here.
|
|
133
|
-
*/
|