maquina-components 0.1.2 → 0.2.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 +349 -138
- data/app/assets/images/maquina.svg +1 -0
- data/app/assets/stylesheets/alert.css +143 -0
- data/app/assets/stylesheets/badge.css +145 -0
- data/app/assets/stylesheets/breadcrumbs.css +163 -0
- data/app/assets/stylesheets/card.css +128 -0
- data/app/assets/stylesheets/dropdown_menu.css +248 -0
- data/app/assets/stylesheets/empty.css +133 -0
- data/app/assets/stylesheets/form.css +617 -0
- data/app/assets/stylesheets/header.css +61 -0
- data/app/assets/stylesheets/maquina_components.css +143 -64
- data/app/assets/stylesheets/pagination.css +154 -0
- data/app/assets/stylesheets/sidebar.css +477 -0
- data/app/assets/stylesheets/table.css +205 -0
- data/app/assets/stylesheets/toggle_group.css +151 -0
- data/app/assets/tailwind/maquina_components_engine/engine.css +16 -0
- data/app/helpers/maquina_components/breadcrumbs_helper.rb +118 -0
- data/app/helpers/maquina_components/dropdown_menu_helper.rb +249 -0
- data/app/helpers/maquina_components/empty_helper.rb +102 -0
- data/app/helpers/{components → maquina_components}/icons_helper.rb +40 -3
- data/app/helpers/maquina_components/pagination_helper.rb +153 -0
- data/app/helpers/maquina_components/sidebar_helper.rb +63 -0
- data/app/helpers/maquina_components/table_helper.rb +144 -0
- data/app/helpers/maquina_components/toggle_group_helper.rb +172 -0
- data/app/javascript/controllers/breadcrumb_controller.js +71 -0
- data/app/javascript/controllers/dropdown_menu_controller.js +203 -0
- data/app/javascript/controllers/menu_button_controller.js +59 -0
- data/app/javascript/controllers/sidebar_controller.js +316 -0
- data/app/javascript/controllers/sidebar_trigger_controller.js +32 -0
- data/app/javascript/controllers/toggle_group_controller.js +178 -0
- data/app/views/components/_alert.html.erb +11 -10
- data/app/views/components/_badge.html.erb +10 -0
- data/app/views/components/_breadcrumbs.html.erb +16 -0
- data/app/views/components/_card.html.erb +4 -8
- data/app/views/components/_dropdown.html.erb +25 -0
- data/app/views/components/_dropdown_menu.html.erb +9 -0
- data/app/views/components/_empty.html.erb +10 -0
- data/app/views/components/_header.html.erb +8 -0
- data/app/views/components/_menu_button.html.erb +44 -0
- data/app/views/components/_pagination.html.erb +12 -33
- data/app/views/components/_separator.html.erb +11 -0
- data/app/views/components/_sidebar.html.erb +30 -20
- data/app/views/components/_simple_table.html.erb +49 -0
- data/app/views/components/_table.html.erb +21 -0
- data/app/views/components/_toggle_group.html.erb +24 -0
- data/app/views/components/alert/_description.html.erb +6 -0
- data/app/views/components/alert/_title.html.erb +6 -0
- data/app/views/components/breadcrumbs/_ellipsis.html.erb +9 -0
- data/app/views/components/breadcrumbs/_item.html.erb +8 -0
- data/app/views/components/breadcrumbs/_link.html.erb +8 -0
- data/app/views/components/breadcrumbs/_list.html.erb +8 -0
- data/app/views/components/breadcrumbs/_page.html.erb +8 -0
- data/app/views/components/breadcrumbs/_separator.html.erb +17 -0
- data/app/views/components/card/_action.html.erb +6 -0
- data/app/views/components/card/_content.html.erb +9 -0
- data/app/views/components/card/_description.html.erb +6 -0
- data/app/views/components/card/_footer.html.erb +17 -0
- data/app/views/components/card/_header.html.erb +9 -0
- data/app/views/components/card/_title.html.erb +9 -0
- data/app/views/components/dropdown_menu/_content.html.erb +20 -0
- data/app/views/components/dropdown_menu/_group.html.erb +12 -0
- data/app/views/components/dropdown_menu/_item.html.erb +29 -0
- data/app/views/components/dropdown_menu/_label.html.erb +13 -0
- data/app/views/components/dropdown_menu/_separator.html.erb +11 -0
- data/app/views/components/dropdown_menu/_shortcut.html.erb +12 -0
- data/app/views/components/dropdown_menu/_trigger.html.erb +24 -0
- data/app/views/components/empty/_content.html.erb +8 -0
- data/app/views/components/empty/_description.html.erb +12 -0
- data/app/views/components/empty/_header.html.erb +8 -0
- data/app/views/components/empty/_media.html.erb +13 -0
- data/app/views/components/empty/_title.html.erb +12 -0
- data/app/views/components/pagination/_content.html.erb +8 -0
- data/app/views/components/pagination/_ellipsis.html.erb +28 -0
- data/app/views/components/pagination/_item.html.erb +8 -0
- data/app/views/components/pagination/_link.html.erb +23 -0
- data/app/views/components/pagination/_next.html.erb +57 -0
- data/app/views/components/pagination/_previous.html.erb +57 -0
- data/app/views/components/sidebar/_content.html.erb +8 -0
- data/app/views/components/sidebar/_footer.html.erb +8 -0
- data/app/views/components/sidebar/_group.html.erb +12 -0
- data/app/views/components/sidebar/_header.html.erb +8 -0
- data/app/views/components/sidebar/_inset.html.erb +8 -0
- data/app/views/components/sidebar/_menu.html.erb +8 -0
- data/app/views/components/sidebar/_menu_button.html.erb +14 -0
- data/app/views/components/sidebar/_menu_item.html.erb +7 -0
- data/app/views/components/sidebar/_menu_link.html.erb +32 -0
- data/app/views/components/sidebar/_provider.html.erb +16 -0
- data/app/views/components/sidebar/_trigger.html.erb +12 -0
- data/app/views/components/stats/_stats_card.html.erb +100 -0
- data/app/views/components/stats/_stats_grid.html.erb +38 -0
- data/app/views/components/table/_body.html.erb +5 -0
- data/app/views/components/table/_caption.html.erb +5 -0
- data/app/views/components/table/_cell.html.erb +5 -0
- data/app/views/components/table/_footer.html.erb +5 -0
- data/app/views/components/table/_head.html.erb +8 -0
- data/app/views/components/table/_header.html.erb +8 -0
- data/app/views/components/table/_row.html.erb +8 -0
- data/app/views/components/toggle_group/_item.html.erb +19 -0
- data/config/importmap.rb +1 -0
- data/lib/generators/maquina_components/install/USAGE +39 -0
- data/lib/generators/maquina_components/install/install_generator.rb +123 -0
- data/lib/generators/maquina_components/install/templates/maquina_components_helper.rb.tt +68 -0
- data/lib/generators/maquina_components/install/templates/theme.css.tt +179 -0
- data/lib/maquina_components/engine.rb +10 -0
- data/lib/maquina_components/version.rb +1 -1
- metadata +116 -12
- data/app/helpers/components/pagination_helper.rb +0 -15
- data/app/views/components/_card_content.html.erb +0 -5
- data/app/views/components/_card_header.html.erb +0 -8
- data/app/views/components/_sidebar_content.html.erb +0 -8
- data/app/views/components/_sidebar_group.html.erb +0 -42
- data/app/views/components/_sidebar_header.html.erb +0 -3
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
/* ===== Sidebar Component Styles ===== */
|
|
2
|
+
/* Comprehensive CSS using data-attribute selectors */
|
|
3
|
+
/* Uses @apply for theme-customizable properties */
|
|
4
|
+
|
|
5
|
+
/* ===== Provider (Wrapper) ===== */
|
|
6
|
+
[data-component="sidebar"] {
|
|
7
|
+
@apply flex min-h-svh w-full;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-component="sidebar"][data-variant="inset"] {
|
|
11
|
+
@apply h-svh;
|
|
12
|
+
background-color: var(--sidebar);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* ===== Sidebar Root ===== */
|
|
16
|
+
[data-sidebar-part="root"] {
|
|
17
|
+
@apply block text-sidebar-foreground;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Prevent transitions on initial load */
|
|
21
|
+
[data-sidebar-part="root"].sidebar-loading,
|
|
22
|
+
[data-sidebar-part="root"].sidebar-loading * {
|
|
23
|
+
transition: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ===== Sidebar Gap (creates space on desktop) ===== */
|
|
27
|
+
[data-sidebar-part="gap"] {
|
|
28
|
+
@apply relative bg-transparent;
|
|
29
|
+
width: var(--sidebar-width);
|
|
30
|
+
transition: width 200ms linear;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[data-sidebar-part="root"][data-collapsible="offcanvas"] [data-sidebar-part="gap"] {
|
|
34
|
+
width: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-sidebar-part="root"][data-side="right"] [data-sidebar-part="gap"] {
|
|
38
|
+
@apply rotate-180;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[data-sidebar-part="root"][data-state="collapsed"][data-collapsible="icon"] [data-sidebar-part="gap"] {
|
|
42
|
+
width: calc(var(--sidebar-width-icon) + 1rem);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ===== Sidebar Backdrop (mobile overlay) ===== */
|
|
46
|
+
[data-sidebar-part="backdrop"] {
|
|
47
|
+
@apply fixed inset-0 z-40 hidden bg-black opacity-0;
|
|
48
|
+
transition: opacity 300ms;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-sidebar-part="backdrop"][data-state="visible"] {
|
|
52
|
+
@apply block opacity-60;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* ===== Sidebar Container (fixed positioned) ===== */
|
|
56
|
+
[data-sidebar-part="container"] {
|
|
57
|
+
@apply fixed inset-y-0 z-50 flex h-svh;
|
|
58
|
+
width: var(--sidebar-width);
|
|
59
|
+
transition: left 200ms linear, right 200ms linear, width 200ms linear;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (min-width: 768px) {
|
|
63
|
+
[data-sidebar-part="container"] {
|
|
64
|
+
@apply p-2;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[data-sidebar-part="root"][data-side="left"] [data-sidebar-part="container"] {
|
|
69
|
+
@apply left-0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-sidebar-part="root"][data-side="right"] [data-sidebar-part="container"] {
|
|
73
|
+
@apply right-0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Collapsed offcanvas - slide out */
|
|
77
|
+
[data-sidebar-part="root"][data-state="collapsed"][data-collapsible="offcanvas"][data-side="left"] [data-sidebar-part="container"] {
|
|
78
|
+
left: calc(var(--sidebar-width) * -1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-sidebar-part="root"][data-state="collapsed"][data-collapsible="offcanvas"][data-side="right"] [data-sidebar-part="container"] {
|
|
82
|
+
right: calc(var(--sidebar-width) * -1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Collapsed icon mode - narrow width */
|
|
86
|
+
[data-sidebar-part="root"][data-state="collapsed"][data-collapsible="icon"] [data-sidebar-part="container"] {
|
|
87
|
+
width: calc(var(--sidebar-width-icon) + 1rem + 2px);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* ===== Sidebar Inner Content Wrapper ===== */
|
|
91
|
+
[data-sidebar-part="inner"] {
|
|
92
|
+
@apply flex h-full w-full flex-col;
|
|
93
|
+
background-color: var(--sidebar);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[data-sidebar-part="root"][data-variant="floating"] [data-sidebar-part="inner"] {
|
|
97
|
+
@apply rounded-lg border shadow-sm;
|
|
98
|
+
border-color: var(--sidebar-border);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-sidebar-part="root"][data-variant="inset"] [data-sidebar-part="inner"] {
|
|
102
|
+
@apply rounded-none border-0 shadow-none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* ===== Sidebar Header ===== */
|
|
106
|
+
[data-sidebar-part="header"] {
|
|
107
|
+
@apply flex flex-col gap-2 p-2;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* ===== Sidebar Footer ===== */
|
|
111
|
+
[data-sidebar-part="footer"] {
|
|
112
|
+
@apply flex flex-col gap-2 p-2;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ===== Sidebar Content (scrollable area) ===== */
|
|
116
|
+
[data-sidebar-part="content"] {
|
|
117
|
+
@apply flex min-h-0 flex-1 flex-col gap-2 overflow-auto;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="content"] {
|
|
121
|
+
@apply overflow-hidden;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* ===== Sidebar Group ===== */
|
|
125
|
+
[data-sidebar-part="group"] {
|
|
126
|
+
@apply relative flex w-full min-w-0 flex-col p-2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ===== Sidebar Group Label ===== */
|
|
130
|
+
[data-sidebar-part="group-label"] {
|
|
131
|
+
@apply flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium uppercase tracking-wide;
|
|
132
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
133
|
+
@apply transition-[margin,opacity] duration-200 ease-linear;
|
|
134
|
+
color: var(--sidebar-foreground);
|
|
135
|
+
opacity: 0.6;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[data-sidebar-part="group-label"] svg {
|
|
139
|
+
@apply size-4 shrink-0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="group-label"] {
|
|
143
|
+
@apply -mt-8 opacity-0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* ===== Sidebar Group Action ===== */
|
|
147
|
+
[data-sidebar-part="group-action"] {
|
|
148
|
+
@apply ml-auto flex aspect-square w-5 items-center justify-center rounded-md p-0;
|
|
149
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
150
|
+
@apply transition-transform;
|
|
151
|
+
color: var(--sidebar-foreground);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
[data-sidebar-part="group-action"]:hover {
|
|
155
|
+
background-color: var(--sidebar-accent);
|
|
156
|
+
color: var(--sidebar-accent-foreground);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-sidebar-part="group-action"] svg {
|
|
160
|
+
@apply size-4 shrink-0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-sidebar-part="group-action"]::after {
|
|
164
|
+
@apply absolute -inset-2 md:hidden;
|
|
165
|
+
content: "";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* ===== Sidebar Menu ===== */
|
|
169
|
+
[data-sidebar-part="menu"] {
|
|
170
|
+
@apply flex w-full min-w-0 flex-col gap-1;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* ===== Sidebar Menu Item ===== */
|
|
174
|
+
[data-sidebar-part="menu-item"] {
|
|
175
|
+
@apply relative; /* group/menu-item */
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* ===== Sidebar Menu Button (base styles) ===== */
|
|
179
|
+
[data-sidebar-part="menu-button"] {
|
|
180
|
+
@apply flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm font-medium;
|
|
181
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
182
|
+
@apply transition-[width,height,padding];
|
|
183
|
+
@apply disabled:pointer-events-none disabled:opacity-50;
|
|
184
|
+
@apply aria-disabled:pointer-events-none aria-disabled:opacity-50;
|
|
185
|
+
color: var(--sidebar-foreground);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[data-sidebar-part="menu-button"]:hover {
|
|
189
|
+
background-color: var(--sidebar-accent);
|
|
190
|
+
color: var(--sidebar-accent-foreground);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
[data-sidebar-part="menu-button"]:active {
|
|
194
|
+
background-color: var(--sidebar-accent);
|
|
195
|
+
color: var(--sidebar-accent-foreground);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
[data-sidebar-part="menu-button"][data-active="true"] {
|
|
199
|
+
@apply font-semibold;
|
|
200
|
+
background-color: var(--sidebar-accent);
|
|
201
|
+
color: var(--sidebar-accent-foreground);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
[data-sidebar-part="menu-button"][data-state="open"]:hover {
|
|
205
|
+
background-color: var(--sidebar-accent);
|
|
206
|
+
color: var(--sidebar-accent-foreground);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[data-sidebar-part="menu-button"] svg {
|
|
210
|
+
@apply size-4 shrink-0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[data-sidebar-part="menu-button"] span:last-child {
|
|
214
|
+
@apply truncate;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Menu Button Sizes */
|
|
218
|
+
[data-sidebar-part="menu-button"][data-size="default"],
|
|
219
|
+
[data-sidebar-part="menu-button"]:not([data-size]) {
|
|
220
|
+
@apply h-8;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
[data-sidebar-part="menu-button"][data-size="sm"] {
|
|
224
|
+
@apply h-7 text-xs;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
[data-sidebar-part="menu-button"][data-size="lg"] {
|
|
228
|
+
@apply h-12;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* Has menu action - add padding */
|
|
232
|
+
.group-has-data-\[sidebar-part\=menu-action\]\/menu-item [data-sidebar-part="menu-button"],
|
|
233
|
+
[data-sidebar-part="menu-item"]:has([data-sidebar-part="menu-action"]) [data-sidebar-part="menu-button"] {
|
|
234
|
+
@apply pr-8;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Icon collapsed mode */
|
|
238
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="menu-button"] {
|
|
239
|
+
@apply size-8 p-2;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="menu-button"][data-size="lg"] {
|
|
243
|
+
@apply size-8 p-0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* ===== Sidebar Menu Link (avatar style variant) ===== */
|
|
247
|
+
[data-sidebar-part="menu-link"] {
|
|
248
|
+
@apply flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm font-medium;
|
|
249
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
250
|
+
@apply transition-[width,height,padding];
|
|
251
|
+
@apply disabled:pointer-events-none disabled:opacity-50;
|
|
252
|
+
@apply aria-disabled:pointer-events-none aria-disabled:opacity-50;
|
|
253
|
+
@apply h-12;
|
|
254
|
+
color: var(--sidebar-foreground);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
[data-sidebar-part="menu-link"]:hover {
|
|
258
|
+
background-color: var(--sidebar-accent);
|
|
259
|
+
color: var(--sidebar-accent-foreground);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
[data-sidebar-part="menu-link"]:active {
|
|
263
|
+
background-color: var(--sidebar-accent);
|
|
264
|
+
color: var(--sidebar-accent-foreground);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
[data-sidebar-part="menu-link"][data-active="true"] {
|
|
268
|
+
@apply font-semibold;
|
|
269
|
+
background-color: var(--sidebar-accent);
|
|
270
|
+
color: var(--sidebar-accent-foreground);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
[data-sidebar-part="menu-link"] svg {
|
|
274
|
+
@apply size-4 shrink-0;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
[data-sidebar-part="menu-link"] span:last-child {
|
|
278
|
+
@apply truncate;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* Has menu action - add padding */
|
|
282
|
+
.group-has-data-\[sidebar-part\=menu-action\]\/menu-item [data-sidebar-part="menu-link"],
|
|
283
|
+
[data-sidebar-part="menu-item"]:has([data-sidebar-part="menu-action"]) [data-sidebar-part="menu-link"] {
|
|
284
|
+
@apply pr-8;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Icon collapsed mode */
|
|
288
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="menu-link"] {
|
|
289
|
+
@apply size-8 p-0;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* ===== Sidebar Menu Avatar ===== */
|
|
293
|
+
[data-sidebar-part="menu-avatar"] {
|
|
294
|
+
@apply flex aspect-square size-8 items-center justify-center rounded-lg;
|
|
295
|
+
background-color: var(--sidebar-primary);
|
|
296
|
+
color: var(--sidebar-primary-foreground);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* ===== Sidebar Menu Action ===== */
|
|
300
|
+
[data-sidebar-part="menu-action"] {
|
|
301
|
+
@apply absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0;
|
|
302
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
303
|
+
@apply transition-transform;
|
|
304
|
+
color: var(--sidebar-foreground);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
[data-sidebar-part="menu-action"]:hover {
|
|
308
|
+
background-color: var(--sidebar-accent);
|
|
309
|
+
color: var(--sidebar-accent-foreground);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
[data-sidebar-part="menu-action"] svg {
|
|
313
|
+
@apply size-4 shrink-0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
[data-sidebar-part="menu-action"]::after {
|
|
317
|
+
@apply absolute -inset-2 md:hidden;
|
|
318
|
+
content: "";
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* Show on hover only (desktop) */
|
|
322
|
+
[data-sidebar-part="menu-action"][data-show-on-hover="true"] {
|
|
323
|
+
@apply opacity-0 group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100;
|
|
324
|
+
@apply group-data-[collapsible=icon]:hidden;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/* ===== Sidebar Trigger ===== */
|
|
328
|
+
[data-sidebar-part="trigger"] {
|
|
329
|
+
@apply inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md;
|
|
330
|
+
@apply text-sm font-medium;
|
|
331
|
+
@apply outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px];
|
|
332
|
+
@apply disabled:pointer-events-none disabled:opacity-50;
|
|
333
|
+
@apply transition-all;
|
|
334
|
+
@apply size-7 shrink-0 -ml-1;
|
|
335
|
+
color: var(--foreground);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
[data-sidebar-part="trigger"]:hover {
|
|
339
|
+
background-color: var(--accent);
|
|
340
|
+
color: var(--accent-foreground);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@media (prefers-color-scheme: dark) {
|
|
344
|
+
[data-sidebar-part="trigger"]:hover {
|
|
345
|
+
background-color: color-mix(in oklch, var(--accent) 50%, transparent);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
[data-sidebar-part="trigger"] svg {
|
|
350
|
+
@apply pointer-events-none size-4 shrink-0;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* ===== Sidebar Inset (main content area) ===== */
|
|
354
|
+
[data-sidebar-part="inset"] {
|
|
355
|
+
@apply relative flex w-full flex-1 flex-col;
|
|
356
|
+
background-color: var(--background);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@media (min-width: 768px) {
|
|
360
|
+
[data-sidebar-part="inset"] {
|
|
361
|
+
/* Peer selector for when sidebar is peer */
|
|
362
|
+
@apply peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0;
|
|
363
|
+
@apply peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/* When sidebar is collapsed, add left margin */
|
|
367
|
+
.peer[data-state="collapsed"] ~ [data-sidebar-part="inset"],
|
|
368
|
+
[data-sidebar-part="root"][data-state="collapsed"] ~ [data-sidebar-part="inset"] {
|
|
369
|
+
@apply ml-2;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* ===== Sidebar Rail (hover to expand) ===== */
|
|
374
|
+
[data-sidebar-part="rail"] {
|
|
375
|
+
@apply absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear;
|
|
376
|
+
@apply after:absolute after:inset-y-0 after:left-1/2 after:w-[2px];
|
|
377
|
+
@apply hover:after:bg-sidebar-border;
|
|
378
|
+
@apply group-data-[side=left]:-right-4 group-data-[side=right]:left-0;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@media (min-width: 768px) {
|
|
382
|
+
[data-sidebar-part="rail"] {
|
|
383
|
+
@apply flex;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
[data-sidebar-part="root"][data-collapsible="offcanvas"] [data-sidebar-part="rail"] {
|
|
388
|
+
@apply translate-x-0 after:left-full;
|
|
389
|
+
@apply group-data-[side=left]:right-2;
|
|
390
|
+
@apply group-data-[side=right]:left-0 group-data-[side=right]:-translate-x-full;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* ===== Sidebar Separator ===== */
|
|
394
|
+
[data-sidebar-part="separator"] {
|
|
395
|
+
@apply mx-2 w-auto;
|
|
396
|
+
background-color: var(--sidebar-border);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* ===== Sidebar Menu Badge ===== */
|
|
400
|
+
[data-sidebar-part="menu-badge"] {
|
|
401
|
+
@apply pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center;
|
|
402
|
+
@apply rounded-md px-1 text-xs font-medium tabular-nums;
|
|
403
|
+
color: var(--sidebar-foreground);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
[data-sidebar-part="menu-item"]:has([data-sidebar-part="menu-action"]) [data-sidebar-part="menu-badge"] {
|
|
407
|
+
/* Shift badge when action button present */
|
|
408
|
+
@apply right-7;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="menu-badge"] {
|
|
412
|
+
@apply hidden;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* ===== Sidebar Menu Skeleton (loading state) ===== */
|
|
416
|
+
[data-sidebar-part="menu-skeleton"] {
|
|
417
|
+
@apply flex h-8 items-center gap-2 rounded-md px-2;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
[data-sidebar-part="menu-skeleton"] [data-skeleton="icon"] {
|
|
421
|
+
@apply size-4 rounded-md;
|
|
422
|
+
background-color: var(--sidebar-accent);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
[data-sidebar-part="menu-skeleton"] [data-skeleton="text"] {
|
|
426
|
+
@apply h-4 max-w-[calc(var(--skeleton-width,100%)-1rem)] flex-1 rounded-md;
|
|
427
|
+
background-color: var(--sidebar-accent);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="menu-skeleton"] {
|
|
431
|
+
@apply size-8;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-part="menu-skeleton"] [data-skeleton="text"] {
|
|
435
|
+
@apply hidden;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/* ===== Utility: Sidebar hidden text in icon mode ===== */
|
|
439
|
+
[data-sidebar-part="root"][data-collapsible="icon"] [data-sidebar-hide-on-collapse] {
|
|
440
|
+
@apply hidden;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/* ===== Sidebar Primary Button (Quick Create style) ===== */
|
|
444
|
+
.sidebar-primary-button {
|
|
445
|
+
@apply flex flex-1 items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm font-medium;
|
|
446
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
447
|
+
@apply transition-colors;
|
|
448
|
+
background-color: var(--sidebar-primary);
|
|
449
|
+
color: var(--sidebar-primary-foreground);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.sidebar-primary-button:hover {
|
|
453
|
+
opacity: 0.9;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.sidebar-primary-button svg {
|
|
457
|
+
@apply size-4 shrink-0;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/* ===== Sidebar Outline Button ===== */
|
|
461
|
+
.sidebar-outline-button {
|
|
462
|
+
@apply flex items-center justify-center rounded-md p-2;
|
|
463
|
+
@apply outline-hidden ring-sidebar-ring focus-visible:ring-2;
|
|
464
|
+
@apply transition-colors;
|
|
465
|
+
@apply border;
|
|
466
|
+
border-color: var(--sidebar-border);
|
|
467
|
+
color: var(--sidebar-foreground);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.sidebar-outline-button:hover {
|
|
471
|
+
background-color: var(--sidebar-accent);
|
|
472
|
+
color: var(--sidebar-accent-foreground);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.sidebar-outline-button svg {
|
|
476
|
+
@apply size-4 shrink-0;
|
|
477
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/* ===== Table Component ===== */
|
|
2
|
+
/* Based on shadcn/ui table with data-component and data-table-part selectors */
|
|
3
|
+
/* Uses theme variables for colors, @apply for spacing/typography */
|
|
4
|
+
|
|
5
|
+
/* ===== Container ===== */
|
|
6
|
+
[data-table-part="container"] {
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-width: 100%;
|
|
10
|
+
overflow-x: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Bordered variant */
|
|
14
|
+
[data-table-part="container"][data-variant="bordered"] {
|
|
15
|
+
border: 1px solid var(--border);
|
|
16
|
+
@apply rounded-lg overflow-hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* ===== Table ===== */
|
|
20
|
+
[data-component="table"] {
|
|
21
|
+
width: 100%;
|
|
22
|
+
min-width: 100%;
|
|
23
|
+
caption-side: bottom;
|
|
24
|
+
border-collapse: collapse;
|
|
25
|
+
@apply text-sm;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* ===== Caption ===== */
|
|
29
|
+
[data-table-part="caption"] {
|
|
30
|
+
color: var(--muted-foreground);
|
|
31
|
+
@apply mt-4 text-sm;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ===== Header ===== */
|
|
35
|
+
[data-table-part="header"] {
|
|
36
|
+
border-bottom: 1px solid var(--border);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-table-part="header"][data-sticky="true"] {
|
|
40
|
+
position: sticky;
|
|
41
|
+
top: 0;
|
|
42
|
+
z-index: 10;
|
|
43
|
+
background-color: var(--muted);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Header rows always have border */
|
|
47
|
+
[data-table-part="header"] [data-table-part="row"] {
|
|
48
|
+
border-bottom: 1px solid var(--border);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ===== Body ===== */
|
|
52
|
+
/* Remove border from last row in body */
|
|
53
|
+
[data-table-part="body"] [data-table-part="row"]:last-child {
|
|
54
|
+
border-bottom: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ===== Footer ===== */
|
|
58
|
+
[data-table-part="footer"] {
|
|
59
|
+
background-color: color-mix(in oklch, var(--muted) 50%, transparent);
|
|
60
|
+
font-weight: 500;
|
|
61
|
+
border-top: 1px solid var(--border);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Remove border from last row in footer */
|
|
65
|
+
[data-table-part="footer"] [data-table-part="row"]:last-child {
|
|
66
|
+
border-bottom: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ===== Row ===== */
|
|
70
|
+
[data-table-part="row"] {
|
|
71
|
+
border-bottom: 1px solid var(--border);
|
|
72
|
+
transition-property: background-color;
|
|
73
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
74
|
+
@apply duration-150;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-table-part="row"]:hover {
|
|
78
|
+
background-color: color-mix(in oklch, var(--muted) 50%, transparent);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-table-part="row"][data-state="selected"] {
|
|
82
|
+
background-color: var(--muted);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ===== Head Cell ===== */
|
|
86
|
+
[data-table-part="head"] {
|
|
87
|
+
color: var(--foreground);
|
|
88
|
+
text-align: left;
|
|
89
|
+
vertical-align: middle;
|
|
90
|
+
@apply h-10 px-4 py-2.5 font-medium whitespace-nowrap text-xs uppercase tracking-wider;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* First column - extra left padding */
|
|
94
|
+
[data-table-part="head"]:first-child {
|
|
95
|
+
@apply pl-6;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Last column - extra right padding */
|
|
99
|
+
[data-table-part="head"]:last-child {
|
|
100
|
+
@apply pr-6;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Checkbox alignment in header */
|
|
104
|
+
[data-table-part="head"]:has([role="checkbox"]) {
|
|
105
|
+
@apply pr-0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-table-part="head"] > [role="checkbox"] {
|
|
109
|
+
@apply translate-y-0.5;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ===== Body Cell ===== */
|
|
113
|
+
[data-table-part="cell"] {
|
|
114
|
+
vertical-align: middle;
|
|
115
|
+
@apply px-4 py-3 whitespace-nowrap;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* First column - extra left padding */
|
|
119
|
+
[data-table-part="cell"]:first-child {
|
|
120
|
+
@apply pl-6;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Last column - extra right padding */
|
|
124
|
+
[data-table-part="cell"]:last-child {
|
|
125
|
+
@apply pr-6;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Checkbox alignment in cells */
|
|
129
|
+
[data-table-part="cell"]:has([role="checkbox"]) {
|
|
130
|
+
@apply pr-0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[data-table-part="cell"] > [role="checkbox"] {
|
|
134
|
+
@apply translate-y-0.5;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* ===== Utility Classes for Cells ===== */
|
|
138
|
+
/* These can be applied via css_classes parameter */
|
|
139
|
+
|
|
140
|
+
/* Right-aligned text (for amounts, numbers) */
|
|
141
|
+
[data-table-part="head"].text-right,
|
|
142
|
+
[data-table-part="cell"].text-right {
|
|
143
|
+
text-align: right;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Center-aligned text */
|
|
147
|
+
[data-table-part="head"].text-center,
|
|
148
|
+
[data-table-part="cell"].text-center {
|
|
149
|
+
text-align: center;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Fixed width columns */
|
|
153
|
+
[data-table-part="head"].w-checkbox,
|
|
154
|
+
[data-table-part="cell"].w-checkbox {
|
|
155
|
+
@apply w-10;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-table-part="head"].w-actions,
|
|
159
|
+
[data-table-part="cell"].w-actions {
|
|
160
|
+
@apply w-12;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Font weight for emphasis */
|
|
164
|
+
[data-table-part="cell"].font-medium {
|
|
165
|
+
@apply font-medium;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* ===== Striped Variant ===== */
|
|
169
|
+
/* Apply data-variant="striped" to the table element */
|
|
170
|
+
[data-component="table"][data-variant="striped"] [data-table-part="body"] [data-table-part="row"]:nth-child(even) {
|
|
171
|
+
background-color: color-mix(in oklch, var(--muted) 30%, transparent);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-component="table"][data-variant="striped"] [data-table-part="body"] [data-table-part="row"]:nth-child(even):hover {
|
|
175
|
+
background-color: color-mix(in oklch, var(--muted) 50%, transparent);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* ===== Empty State ===== */
|
|
179
|
+
[data-table-part="cell"][data-empty="true"] {
|
|
180
|
+
color: var(--muted-foreground);
|
|
181
|
+
text-align: center;
|
|
182
|
+
@apply py-8;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ===== Responsive: Compact on mobile ===== */
|
|
186
|
+
@media (max-width: 640px) {
|
|
187
|
+
[data-table-part="head"],
|
|
188
|
+
[data-table-part="cell"] {
|
|
189
|
+
@apply px-2 py-2;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[data-table-part="head"]:first-child,
|
|
193
|
+
[data-table-part="cell"]:first-child {
|
|
194
|
+
@apply pl-4;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
[data-table-part="head"]:last-child,
|
|
198
|
+
[data-table-part="cell"]:last-child {
|
|
199
|
+
@apply pr-4;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
[data-table-part="head"] {
|
|
203
|
+
@apply h-8;
|
|
204
|
+
}
|
|
205
|
+
}
|