@gridkitjs/theme-tailwind 0.4.0 → 0.5.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.
- package/package.json +1 -1
- package/src/styles.css +248 -7
package/package.json
CHANGED
package/src/styles.css
CHANGED
|
@@ -395,6 +395,41 @@
|
|
|
395
395
|
background-color: var(--gridkit-surface-muted);
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
+
/*
|
|
399
|
+
* Docked before the label, in normal flow rather than absolutely
|
|
400
|
+
* positioned like the sort toggle and resize handle — see the component's
|
|
401
|
+
* own note on why. Faint until grouped, hovered, or focused, the same
|
|
402
|
+
* restraint `.header-sort-toggle` uses for an unsorted header.
|
|
403
|
+
*/
|
|
404
|
+
.gridkit-data-grid .header-group-toggle {
|
|
405
|
+
display: inline-flex;
|
|
406
|
+
align-items: center;
|
|
407
|
+
vertical-align: middle;
|
|
408
|
+
margin-right: 0.375rem;
|
|
409
|
+
cursor: pointer;
|
|
410
|
+
color: var(--gridkit-fg-muted);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.gridkit-data-grid .header-group-toggle svg {
|
|
414
|
+
width: 14px;
|
|
415
|
+
height: 14px;
|
|
416
|
+
flex-shrink: 0;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.gridkit-data-grid .header-group-toggle:not(.is-grouped) {
|
|
420
|
+
opacity: 0.35;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.gridkit-data-grid .grid-header .header-cell:hover .header-group-toggle,
|
|
424
|
+
.gridkit-data-grid .header-cell:focus-visible .header-group-toggle {
|
|
425
|
+
opacity: 1;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.gridkit-data-grid .header-group-toggle.is-grouped {
|
|
429
|
+
opacity: 1;
|
|
430
|
+
color: var(--gridkit-accent);
|
|
431
|
+
}
|
|
432
|
+
|
|
398
433
|
.gridkit-data-grid .grid-cell {
|
|
399
434
|
padding: 0.5rem;
|
|
400
435
|
}
|
|
@@ -408,6 +443,62 @@
|
|
|
408
443
|
background-color: var(--gridkit-surface-muted);
|
|
409
444
|
}
|
|
410
445
|
|
|
446
|
+
/*
|
|
447
|
+
* A group header — one cell spanning every column, not a `.grid-cell` — so
|
|
448
|
+
* it gets its own rules rather than sharing the data-cell ones above.
|
|
449
|
+
*/
|
|
450
|
+
.gridkit-data-grid .grid-group-row {
|
|
451
|
+
cursor: pointer;
|
|
452
|
+
background-color: var(--gridkit-surface-muted);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.gridkit-data-grid .grid-group-row:hover {
|
|
456
|
+
background-color: var(--gridkit-selected);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/*
|
|
460
|
+
* Padding lives on `.grid-group-cell-content` (the inner `div`), not here:
|
|
461
|
+
* see that component's own note on why the flex layout is one level in
|
|
462
|
+
* rather than on the `<td>` itself.
|
|
463
|
+
*/
|
|
464
|
+
.gridkit-data-grid .grid-group-cell {
|
|
465
|
+
padding: 0;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.gridkit-data-grid .grid-group-cell:focus-visible {
|
|
469
|
+
outline: 2px solid var(--gridkit-accent);
|
|
470
|
+
outline-offset: -2px;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.gridkit-data-grid .grid-group-cell-content {
|
|
474
|
+
display: flex;
|
|
475
|
+
align-items: center;
|
|
476
|
+
gap: 0.5rem;
|
|
477
|
+
padding: 0.5rem;
|
|
478
|
+
font-weight: 600;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/* A right-pointing triangle that rotates open on expand. */
|
|
482
|
+
.gridkit-data-grid .grid-group-row .group-toggle {
|
|
483
|
+
display: inline-block;
|
|
484
|
+
flex-shrink: 0;
|
|
485
|
+
width: 0;
|
|
486
|
+
height: 0;
|
|
487
|
+
border-style: solid;
|
|
488
|
+
border-width: 0.25rem 0 0.25rem 0.4rem;
|
|
489
|
+
border-color: transparent transparent transparent var(--gridkit-fg-muted);
|
|
490
|
+
transition: transform 0.1s ease;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.gridkit-data-grid .grid-group-row .group-toggle.is-expanded {
|
|
494
|
+
transform: rotate(90deg);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.gridkit-data-grid .grid-group-row .group-count {
|
|
498
|
+
font-weight: 400;
|
|
499
|
+
color: var(--gridkit-fg-muted);
|
|
500
|
+
}
|
|
501
|
+
|
|
411
502
|
/*
|
|
412
503
|
* Selection, after the hover rules so that a selected row hovered stays
|
|
413
504
|
* selected — the two would otherwise be the same colour, since hover already
|
|
@@ -461,7 +552,8 @@
|
|
|
461
552
|
|
|
462
553
|
/* Horizontal borders */
|
|
463
554
|
.gridkit-data-grid.borders-horizontal .grid-header .header-cell,
|
|
464
|
-
.gridkit-data-grid.borders-horizontal .grid-cell
|
|
555
|
+
.gridkit-data-grid.borders-horizontal .grid-cell,
|
|
556
|
+
.gridkit-data-grid.borders-horizontal .grid-group-cell {
|
|
465
557
|
border-bottom: 1px solid var(--gridkit-line);
|
|
466
558
|
}
|
|
467
559
|
|
|
@@ -469,8 +561,13 @@
|
|
|
469
561
|
* The last row's bottom edge has no row below it to collapse with, so
|
|
470
562
|
* unlike every internal boundary it is a genuinely extra pixel — the same
|
|
471
563
|
* reason `borders-vertical` drops its `:last-child` border-right below.
|
|
564
|
+
* Matched against both row kinds: the last rendered row can just as well
|
|
565
|
+
* be a collapsed group header as a data row.
|
|
472
566
|
*/
|
|
473
|
-
.gridkit-data-grid.borders-horizontal .grid-row:last-child .grid-cell
|
|
567
|
+
.gridkit-data-grid.borders-horizontal .grid-row:last-child .grid-cell,
|
|
568
|
+
.gridkit-data-grid.borders-horizontal
|
|
569
|
+
.grid-group-row:last-child
|
|
570
|
+
.grid-group-cell {
|
|
474
571
|
border-bottom: none;
|
|
475
572
|
}
|
|
476
573
|
|
|
@@ -487,7 +584,8 @@
|
|
|
487
584
|
|
|
488
585
|
/* Borders on all sides */
|
|
489
586
|
.gridkit-data-grid.borders-all .grid-header .header-cell,
|
|
490
|
-
.gridkit-data-grid.borders-all .grid-cell
|
|
587
|
+
.gridkit-data-grid.borders-all .grid-cell,
|
|
588
|
+
.gridkit-data-grid.borders-all .grid-group-cell {
|
|
491
589
|
border-bottom: 1px solid var(--gridkit-line);
|
|
492
590
|
border-right: 1px solid var(--gridkit-line);
|
|
493
591
|
}
|
|
@@ -495,19 +593,162 @@
|
|
|
495
593
|
/*
|
|
496
594
|
* The outer left/right edges have no neighbouring cell to collapse with, so
|
|
497
595
|
* unlike every internal boundary they are a genuinely extra pixel — without
|
|
498
|
-
* this the table would render 2px wider than the sum of its columns.
|
|
596
|
+
* this the table would render 2px wider than the sum of its columns. A
|
|
597
|
+
* group cell is both its row's first and last child at once (it is the
|
|
598
|
+
* only cell), so it takes both exceptions.
|
|
499
599
|
*/
|
|
500
600
|
.gridkit-data-grid.borders-all .grid-header .header-cell:first-child,
|
|
501
|
-
.gridkit-data-grid.borders-all .grid-cell:first-child
|
|
601
|
+
.gridkit-data-grid.borders-all .grid-cell:first-child,
|
|
602
|
+
.gridkit-data-grid.borders-all .grid-group-cell {
|
|
502
603
|
border-left: none;
|
|
503
604
|
}
|
|
504
605
|
|
|
505
606
|
.gridkit-data-grid.borders-all .grid-header .header-cell:last-child,
|
|
506
|
-
.gridkit-data-grid.borders-all .grid-cell:last-child
|
|
607
|
+
.gridkit-data-grid.borders-all .grid-cell:last-child,
|
|
608
|
+
.gridkit-data-grid.borders-all .grid-group-cell {
|
|
507
609
|
border-right: none;
|
|
508
610
|
}
|
|
509
611
|
|
|
510
|
-
.gridkit-data-grid.borders-all .grid-row:last-child .grid-cell
|
|
612
|
+
.gridkit-data-grid.borders-all .grid-row:last-child .grid-cell,
|
|
613
|
+
.gridkit-data-grid.borders-all .grid-group-row:last-child .grid-group-cell {
|
|
511
614
|
border-bottom: none;
|
|
512
615
|
}
|
|
616
|
+
|
|
617
|
+
/*
|
|
618
|
+
* The group-by bar. A sibling of the table, not a row inside it — see
|
|
619
|
+
* `GroupByBar.tsx`'s own note on why — so it's unscoped by `.gridkit-data-grid`
|
|
620
|
+
* the way `.gridkit-sr-only` is.
|
|
621
|
+
*/
|
|
622
|
+
.gridkit-group-by-bar {
|
|
623
|
+
display: flex;
|
|
624
|
+
flex-wrap: wrap;
|
|
625
|
+
align-items: center;
|
|
626
|
+
gap: 0.5rem;
|
|
627
|
+
padding: 0.5rem;
|
|
628
|
+
background-color: var(--gridkit-surface);
|
|
629
|
+
border-bottom: 1px solid var(--gridkit-line);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/*
|
|
633
|
+
* Drawn while a chip or an eligible header is being dragged — a dashed
|
|
634
|
+
* outline marking the bar itself as a valid drop zone, load-bearing when
|
|
635
|
+
* it's otherwise empty, with no chip of its own to show a drop indicator
|
|
636
|
+
* on. Where exactly the drop would land is the chips' own
|
|
637
|
+
* `is-drop-before`/`is-drop-after` marks; this outline doesn't also wash
|
|
638
|
+
* the bar's background once hovered — the marks are enough on their own.
|
|
639
|
+
*/
|
|
640
|
+
.gridkit-group-by-bar.is-drag-target {
|
|
641
|
+
outline: 2px dashed var(--gridkit-accent);
|
|
642
|
+
outline-offset: -2px;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/*
|
|
646
|
+
* A header already in the group-by stack, dragged back toward it — never a
|
|
647
|
+
* valid drop, so no accent outline invites it: a muted dashed line in the
|
|
648
|
+
* same neutral tone as the grid's own borders, plus a `not-allowed` cursor
|
|
649
|
+
* for the pointer icon itself.
|
|
650
|
+
*/
|
|
651
|
+
.gridkit-group-by-bar.is-drag-blocked {
|
|
652
|
+
cursor: not-allowed;
|
|
653
|
+
outline: 2px dashed var(--gridkit-line);
|
|
654
|
+
outline-offset: -2px;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.group-by-bar-placeholder {
|
|
658
|
+
font-size: 0.8125rem;
|
|
659
|
+
color: var(--gridkit-fg-muted);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.group-by-chip {
|
|
663
|
+
position: relative;
|
|
664
|
+
display: inline-flex;
|
|
665
|
+
align-items: center;
|
|
666
|
+
gap: 0.375rem;
|
|
667
|
+
padding: 0.25rem 0.5rem;
|
|
668
|
+
font-size: 0.8125rem;
|
|
669
|
+
color: var(--gridkit-fg);
|
|
670
|
+
background-color: var(--gridkit-selected);
|
|
671
|
+
border-radius: 9999px;
|
|
672
|
+
cursor: grab;
|
|
673
|
+
touch-action: none;
|
|
674
|
+
user-select: none;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.group-by-chip:focus-visible {
|
|
678
|
+
outline: 2px solid var(--gridkit-accent);
|
|
679
|
+
outline-offset: 1px;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
.group-by-chip.is-dragging {
|
|
683
|
+
cursor: grabbing;
|
|
684
|
+
opacity: 0.5;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/*
|
|
688
|
+
* Where the chip would land. `.header-cell.is-drop-before`/`.is-drop-after`
|
|
689
|
+
* draw this as an inset line, but an inset line on a pill this round would
|
|
690
|
+
* be clipped by the chip's own `border-radius` into a curved sliver rather
|
|
691
|
+
* than a clean mark — so this is a `::before`/`::after` mark of its own
|
|
692
|
+
* instead, sitting in the gap beside the chip. Absolutely positioned and
|
|
693
|
+
* so out of flow, it never shifts the chip or its neighbors the way a
|
|
694
|
+
* change to border or padding would.
|
|
695
|
+
*/
|
|
696
|
+
.group-by-chip.is-drop-before::before,
|
|
697
|
+
.group-by-chip.is-drop-after::after {
|
|
698
|
+
content: "";
|
|
699
|
+
position: absolute;
|
|
700
|
+
top: 0;
|
|
701
|
+
bottom: 0;
|
|
702
|
+
width: 2px;
|
|
703
|
+
border-radius: 1px;
|
|
704
|
+
background-color: var(--gridkit-accent);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.group-by-chip.is-drop-before::before {
|
|
708
|
+
left: calc(-0.25rem - 1px);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.group-by-chip.is-drop-after::after {
|
|
712
|
+
right: calc(-0.25rem - 1px);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/*
|
|
716
|
+
* The chip trailing the pointer mid-drag. Unlike the header's own
|
|
717
|
+
* `.gridkit-data-grid.drag-ghost` this can't share that compound selector
|
|
718
|
+
* — a chip ghost isn't part of the grid's own table — so it restates the
|
|
719
|
+
* positioning in full rather than only the parts that differ.
|
|
720
|
+
*/
|
|
721
|
+
.group-by-chip.drag-ghost {
|
|
722
|
+
position: fixed;
|
|
723
|
+
top: 0;
|
|
724
|
+
left: 0;
|
|
725
|
+
z-index: 50;
|
|
726
|
+
border: 1px dashed var(--gridkit-accent);
|
|
727
|
+
opacity: 0.75;
|
|
728
|
+
pointer-events: none;
|
|
729
|
+
will-change: transform;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.group-by-chip-remove {
|
|
733
|
+
display: inline-flex;
|
|
734
|
+
align-items: center;
|
|
735
|
+
justify-content: center;
|
|
736
|
+
width: 1rem;
|
|
737
|
+
height: 1rem;
|
|
738
|
+
padding: 0;
|
|
739
|
+
line-height: 1;
|
|
740
|
+
color: inherit;
|
|
741
|
+
cursor: pointer;
|
|
742
|
+
background: none;
|
|
743
|
+
border: none;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.group-by-chip-remove:hover {
|
|
747
|
+
color: var(--gridkit-accent);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.group-by-chip-remove:focus-visible {
|
|
751
|
+
outline: 2px solid var(--gridkit-accent);
|
|
752
|
+
outline-offset: 1px;
|
|
753
|
+
}
|
|
513
754
|
}
|