zenkit-css 1.0.7 → 1.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.
@@ -0,0 +1,691 @@
1
+ // ========================================
2
+ // ZenKit - Table Component
3
+ // ========================================
4
+
5
+ @use '../abstracts/variables' as *;
6
+
7
+ // ----------------------------------------
8
+ // Table Container
9
+ // ----------------------------------------
10
+ .table-container {
11
+ width: 100%;
12
+ overflow-x: auto;
13
+ -webkit-overflow-scrolling: touch;
14
+ }
15
+
16
+ // ----------------------------------------
17
+ // Table Base
18
+ // ----------------------------------------
19
+ .table {
20
+ width: 100%;
21
+ border-collapse: collapse;
22
+ border-spacing: 0;
23
+ font-size: var(--text-sm);
24
+ color: var(--text);
25
+ background-color: var(--bg);
26
+ }
27
+
28
+ // ----------------------------------------
29
+ // Table Header
30
+ // ----------------------------------------
31
+ .table thead {
32
+ background-color: var(--gray-50);
33
+ }
34
+
35
+ .table th {
36
+ padding: 0.75rem 1rem;
37
+ font-weight: $font-weight-semibold;
38
+ text-align: left;
39
+ color: var(--text);
40
+ border-bottom: 2px solid var(--border);
41
+ white-space: nowrap;
42
+ }
43
+
44
+ // ----------------------------------------
45
+ // Table Body
46
+ // ----------------------------------------
47
+ .table td {
48
+ padding: 0.75rem 1rem;
49
+ border-bottom: 1px solid var(--border);
50
+ vertical-align: middle;
51
+ }
52
+
53
+ .table tbody tr {
54
+ transition: background-color $transition-fast $transition-timing;
55
+ }
56
+
57
+ // ----------------------------------------
58
+ // Table Variants
59
+ // ----------------------------------------
60
+
61
+ // Striped
62
+ .table-striped tbody tr:nth-child(odd) {
63
+ background-color: var(--gray-50);
64
+ }
65
+
66
+ // Hover
67
+ .table-hover tbody tr:hover {
68
+ background-color: var(--gray-100);
69
+ }
70
+
71
+ // Bordered
72
+ .table-bordered {
73
+ border: 1px solid var(--border);
74
+
75
+ th,
76
+ td {
77
+ border: 1px solid var(--border);
78
+ }
79
+ }
80
+
81
+ // Borderless
82
+ .table-borderless {
83
+ th,
84
+ td {
85
+ border: none;
86
+ }
87
+ }
88
+
89
+ // ----------------------------------------
90
+ // Table Sizes
91
+ // ----------------------------------------
92
+ .table-sm {
93
+ th,
94
+ td {
95
+ padding: 0.5rem 0.75rem;
96
+ font-size: var(--text-xs);
97
+ }
98
+ }
99
+
100
+ .table-lg {
101
+ th,
102
+ td {
103
+ padding: 1rem 1.25rem;
104
+ font-size: var(--text-base);
105
+ }
106
+ }
107
+
108
+ // ----------------------------------------
109
+ // Table Alignment
110
+ // ----------------------------------------
111
+ .table-center {
112
+ th,
113
+ td {
114
+ text-align: center;
115
+ }
116
+ }
117
+
118
+ .table-right {
119
+ th,
120
+ td {
121
+ text-align: right;
122
+ }
123
+ }
124
+
125
+ // Column alignment
126
+ .text-left { text-align: left; }
127
+ .text-center { text-align: center; }
128
+ .text-right { text-align: right; }
129
+
130
+ // ----------------------------------------
131
+ // Sortable Columns
132
+ // ----------------------------------------
133
+ .table-sortable th {
134
+ cursor: pointer;
135
+ user-select: none;
136
+ position: relative;
137
+ padding-right: 1.75rem;
138
+
139
+ &:hover {
140
+ background-color: var(--gray-100);
141
+ }
142
+
143
+ &::after {
144
+ content: "";
145
+ position: absolute;
146
+ right: 0.5rem;
147
+ top: 50%;
148
+ transform: translateY(-50%);
149
+ width: 0;
150
+ height: 0;
151
+ border-left: 4px solid transparent;
152
+ border-right: 4px solid transparent;
153
+ border-top: 5px solid var(--gray-400);
154
+ opacity: 0.3;
155
+ }
156
+ }
157
+
158
+ .table-sortable th.sort-asc {
159
+ &::after {
160
+ border-top: none;
161
+ border-bottom: 5px solid var(--primary);
162
+ opacity: 1;
163
+ }
164
+ }
165
+
166
+ .table-sortable th.sort-desc {
167
+ &::after {
168
+ border-top: 5px solid var(--primary);
169
+ border-bottom: none;
170
+ opacity: 1;
171
+ }
172
+ }
173
+
174
+ .table-sortable th.sort-none {
175
+ &::after {
176
+ opacity: 0.3;
177
+ }
178
+ }
179
+
180
+ // ----------------------------------------
181
+ // Selectable Rows
182
+ // ----------------------------------------
183
+ .table-selectable tbody tr {
184
+ cursor: pointer;
185
+ }
186
+
187
+ .table-selectable tbody tr.selected {
188
+ background-color: var(--primary-50);
189
+
190
+ &:hover {
191
+ background-color: var(--primary-100);
192
+ }
193
+ }
194
+
195
+ // Checkbox column
196
+ .table-select-col {
197
+ width: 3rem;
198
+ text-align: center;
199
+ }
200
+
201
+ .table-checkbox {
202
+ width: 1rem;
203
+ height: 1rem;
204
+ cursor: pointer;
205
+ }
206
+
207
+ // ----------------------------------------
208
+ // Expandable Rows
209
+ // ----------------------------------------
210
+ .table-expandable tr.expandable-row {
211
+ cursor: pointer;
212
+ }
213
+
214
+ .table-expand-icon {
215
+ display: inline-flex;
216
+ align-items: center;
217
+ justify-content: center;
218
+ width: 1.5rem;
219
+ height: 1.5rem;
220
+ margin-right: 0.5rem;
221
+ transition: transform $transition-base $transition-timing;
222
+
223
+ &::before {
224
+ content: "";
225
+ border: solid var(--text);
226
+ border-width: 0 2px 2px 0;
227
+ display: inline-block;
228
+ padding: 3px;
229
+ transform: rotate(-45deg);
230
+ }
231
+ }
232
+
233
+ .table-expandable tr.expanded .table-expand-icon {
234
+ &::before {
235
+ transform: rotate(45deg);
236
+ }
237
+ }
238
+
239
+ .table-expanded-content {
240
+ background-color: var(--gray-50);
241
+
242
+ td {
243
+ padding: 1rem 1.5rem;
244
+ border-bottom: 1px solid var(--border);
245
+ }
246
+ }
247
+
248
+ // ----------------------------------------
249
+ // Fixed Header
250
+ // ----------------------------------------
251
+ .table-fixed-header {
252
+ position: relative;
253
+
254
+ thead {
255
+ position: sticky;
256
+ top: 0;
257
+ z-index: 10;
258
+ background-color: var(--bg);
259
+ box-shadow: 0 1px 0 var(--border);
260
+ }
261
+ }
262
+
263
+ // ----------------------------------------
264
+ // Fixed Column
265
+ // ----------------------------------------
266
+ .table-fixed-col {
267
+ th:first-child,
268
+ td:first-child {
269
+ position: sticky;
270
+ left: 0;
271
+ z-index: 5;
272
+ background-color: inherit;
273
+ box-shadow: 1px 0 0 var(--border);
274
+ }
275
+ }
276
+
277
+ // ----------------------------------------
278
+ // Loading State
279
+ // ----------------------------------------
280
+ .table-loading {
281
+ position: relative;
282
+ pointer-events: none;
283
+ opacity: 0.6;
284
+ }
285
+
286
+ .table-loading-overlay {
287
+ position: absolute;
288
+ top: 0;
289
+ left: 0;
290
+ right: 0;
291
+ bottom: 0;
292
+ display: flex;
293
+ align-items: center;
294
+ justify-content: center;
295
+ background-color: rgba(255, 255, 255, 0.7);
296
+ z-index: 20;
297
+ }
298
+
299
+ // ----------------------------------------
300
+ // Empty State
301
+ // ----------------------------------------
302
+ .table-empty {
303
+ td {
304
+ text-align: center;
305
+ padding: 3rem 1rem;
306
+ color: var(--text-muted);
307
+ }
308
+ }
309
+
310
+ .table-empty-icon {
311
+ font-size: 2.5rem;
312
+ margin-bottom: 0.75rem;
313
+ opacity: 0.5;
314
+ }
315
+
316
+ .table-empty-text {
317
+ font-size: var(--text-sm);
318
+ }
319
+
320
+ // ----------------------------------------
321
+ // Table Footer
322
+ // ----------------------------------------
323
+ .table tfoot {
324
+ background-color: var(--gray-50);
325
+ font-weight: $font-weight-medium;
326
+
327
+ td {
328
+ border-top: 2px solid var(--border);
329
+ border-bottom: none;
330
+ }
331
+ }
332
+
333
+ // ----------------------------------------
334
+ // Table Caption
335
+ // ----------------------------------------
336
+ .table caption {
337
+ padding: 0.75rem 1rem;
338
+ color: var(--text-muted);
339
+ font-size: var(--text-sm);
340
+ text-align: left;
341
+ caption-side: bottom;
342
+ }
343
+
344
+ .table-caption-top caption {
345
+ caption-side: top;
346
+ }
347
+
348
+ // ----------------------------------------
349
+ // Responsive Table
350
+ // ----------------------------------------
351
+ .table-responsive {
352
+ display: block;
353
+ width: 100%;
354
+ overflow-x: auto;
355
+ -webkit-overflow-scrolling: touch;
356
+ }
357
+
358
+ @media (max-width: 767px) {
359
+ .table-responsive-stack {
360
+ thead {
361
+ display: none;
362
+ }
363
+
364
+ tbody tr {
365
+ display: block;
366
+ margin-bottom: 1rem;
367
+ border: 1px solid var(--border);
368
+ border-radius: $border-radius;
369
+ }
370
+
371
+ td {
372
+ display: flex;
373
+ justify-content: space-between;
374
+ padding: 0.75rem 1rem;
375
+ border-bottom: 1px solid var(--border);
376
+
377
+ &::before {
378
+ content: attr(data-label);
379
+ font-weight: $font-weight-semibold;
380
+ margin-right: 1rem;
381
+ }
382
+
383
+ &:last-child {
384
+ border-bottom: none;
385
+ }
386
+ }
387
+ }
388
+ }
389
+
390
+ // ----------------------------------------
391
+ // Cell Utilities
392
+ // ----------------------------------------
393
+ .cell-nowrap {
394
+ white-space: nowrap;
395
+ }
396
+
397
+ .cell-truncate {
398
+ max-width: 200px;
399
+ overflow: hidden;
400
+ text-overflow: ellipsis;
401
+ white-space: nowrap;
402
+ }
403
+
404
+ .cell-wrap {
405
+ white-space: normal;
406
+ word-wrap: break-word;
407
+ }
408
+
409
+ // ----------------------------------------
410
+ // Row States
411
+ // ----------------------------------------
412
+ .table tr.row-success {
413
+ background-color: var(--success-50);
414
+ }
415
+
416
+ .table tr.row-warning {
417
+ background-color: var(--warning-50);
418
+ }
419
+
420
+ .table tr.row-danger {
421
+ background-color: var(--danger-50);
422
+ }
423
+
424
+ .table tr.row-info {
425
+ background-color: var(--info-50);
426
+ }
427
+
428
+ .table tr.row-muted {
429
+ color: var(--text-muted);
430
+ opacity: 0.7;
431
+ }
432
+
433
+ // ----------------------------------------
434
+ // Table Actions Column
435
+ // ----------------------------------------
436
+ .table-actions {
437
+ width: 1%;
438
+ white-space: nowrap;
439
+ text-align: right;
440
+ }
441
+
442
+ .table-action-btn {
443
+ display: inline-flex;
444
+ align-items: center;
445
+ justify-content: center;
446
+ width: 2rem;
447
+ height: 2rem;
448
+ padding: 0;
449
+ background: transparent;
450
+ border: none;
451
+ border-radius: $border-radius;
452
+ color: var(--text-muted);
453
+ cursor: pointer;
454
+ transition: all $transition-fast $transition-timing;
455
+
456
+ &:hover {
457
+ background-color: var(--gray-100);
458
+ color: var(--text);
459
+ }
460
+
461
+ &:focus {
462
+ outline: none;
463
+ box-shadow: 0 0 0 2px var(--primary-200);
464
+ }
465
+ }
466
+
467
+ // ----------------------------------------
468
+ // Table Toolbar
469
+ // ----------------------------------------
470
+ .table-toolbar {
471
+ display: flex;
472
+ align-items: center;
473
+ justify-content: space-between;
474
+ padding: 0.75rem 1rem;
475
+ background-color: var(--gray-50);
476
+ border: 1px solid var(--border);
477
+ border-bottom: none;
478
+ border-radius: $border-radius $border-radius 0 0;
479
+ gap: 1rem;
480
+ }
481
+
482
+ .table-toolbar-left,
483
+ .table-toolbar-right {
484
+ display: flex;
485
+ align-items: center;
486
+ gap: 0.5rem;
487
+ }
488
+
489
+ .table-search {
490
+ min-width: 200px;
491
+ }
492
+
493
+ .table-filter-btn {
494
+ display: inline-flex;
495
+ align-items: center;
496
+ gap: 0.25rem;
497
+ }
498
+
499
+ // ----------------------------------------
500
+ // Table with Toolbar
501
+ // ----------------------------------------
502
+ .table-wrapper {
503
+ border: 1px solid var(--border);
504
+ border-radius: $border-radius;
505
+ overflow: hidden;
506
+
507
+ .table {
508
+ border: none;
509
+ border-radius: 0;
510
+ }
511
+ }
512
+
513
+ // ----------------------------------------
514
+ // Pagination Integration
515
+ // ----------------------------------------
516
+ .table-pagination {
517
+ display: flex;
518
+ align-items: center;
519
+ justify-content: space-between;
520
+ padding: 0.75rem 1rem;
521
+ background-color: var(--gray-50);
522
+ border-top: 1px solid var(--border);
523
+ }
524
+
525
+ .table-page-info {
526
+ font-size: var(--text-sm);
527
+ color: var(--text-muted);
528
+ }
529
+
530
+ .table-page-size {
531
+ display: flex;
532
+ align-items: center;
533
+ gap: 0.5rem;
534
+ font-size: var(--text-sm);
535
+ }
536
+
537
+ // ----------------------------------------
538
+ // Column Resizing
539
+ // ----------------------------------------
540
+ .table-resizable th {
541
+ position: relative;
542
+ }
543
+
544
+ .table-resize-handle {
545
+ position: absolute;
546
+ right: 0;
547
+ top: 0;
548
+ bottom: 0;
549
+ width: 4px;
550
+ cursor: col-resize;
551
+ background: transparent;
552
+
553
+ &:hover {
554
+ background-color: var(--primary);
555
+ }
556
+ }
557
+
558
+ // ----------------------------------------
559
+ // Drag & Drop Rows
560
+ // ----------------------------------------
561
+ .table-draggable tbody tr {
562
+ cursor: grab;
563
+ }
564
+
565
+ .table-draggable tbody tr:active {
566
+ cursor: grabbing;
567
+ }
568
+
569
+ .table-drag-handle {
570
+ display: inline-flex;
571
+ align-items: center;
572
+ justify-content: center;
573
+ width: 1.5rem;
574
+ color: var(--text-muted);
575
+ cursor: grab;
576
+
577
+ &::before {
578
+ content: "⋮⋮";
579
+ font-size: 0.875rem;
580
+ }
581
+ }
582
+
583
+ .table-row-dragging {
584
+ opacity: 0.5;
585
+ background-color: var(--primary-50);
586
+ }
587
+
588
+ .table-row-drop-target {
589
+ box-shadow: 0 -2px 0 var(--primary);
590
+ }
591
+
592
+ // ----------------------------------------
593
+ // Virtual Scroll Placeholder
594
+ // ----------------------------------------
595
+ .table-virtual-scroll {
596
+ position: relative;
597
+ }
598
+
599
+ .table-virtual-row {
600
+ position: absolute;
601
+ width: 100%;
602
+ }
603
+
604
+ // ----------------------------------------
605
+ // Dark Mode
606
+ // ----------------------------------------
607
+ [data-theme="dark"] {
608
+ .table {
609
+ background-color: var(--gray-900);
610
+ color: var(--gray-100);
611
+ }
612
+
613
+ .table thead {
614
+ background-color: var(--gray-800);
615
+ }
616
+
617
+ .table th {
618
+ border-color: var(--gray-700);
619
+ }
620
+
621
+ .table td {
622
+ border-color: var(--gray-700);
623
+ }
624
+
625
+ .table-striped tbody tr:nth-child(odd) {
626
+ background-color: var(--gray-800);
627
+ }
628
+
629
+ .table-hover tbody tr:hover {
630
+ background-color: var(--gray-700);
631
+ }
632
+
633
+ .table-bordered {
634
+ border-color: var(--gray-700);
635
+
636
+ th,
637
+ td {
638
+ border-color: var(--gray-700);
639
+ }
640
+ }
641
+
642
+ .table-selectable tbody tr.selected {
643
+ background-color: rgba($primary, 0.2);
644
+
645
+ &:hover {
646
+ background-color: rgba($primary, 0.3);
647
+ }
648
+ }
649
+
650
+ .table-expanded-content {
651
+ background-color: var(--gray-800);
652
+ }
653
+
654
+ .table-fixed-header thead {
655
+ background-color: var(--gray-800);
656
+ }
657
+
658
+ .table-loading-overlay {
659
+ background-color: rgba(0, 0, 0, 0.5);
660
+ }
661
+
662
+ .table tfoot {
663
+ background-color: var(--gray-800);
664
+ }
665
+
666
+ .table-toolbar,
667
+ .table-pagination {
668
+ background-color: var(--gray-800);
669
+ border-color: var(--gray-700);
670
+ }
671
+
672
+ .table-action-btn:hover {
673
+ background-color: var(--gray-700);
674
+ }
675
+
676
+ .table tr.row-success {
677
+ background-color: rgba($success, 0.15);
678
+ }
679
+
680
+ .table tr.row-warning {
681
+ background-color: rgba($warning, 0.15);
682
+ }
683
+
684
+ .table tr.row-danger {
685
+ background-color: rgba($danger, 0.15);
686
+ }
687
+
688
+ .table tr.row-info {
689
+ background-color: rgba($info, 0.15);
690
+ }
691
+ }