@gridkitjs/theme-tailwind 0.4.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/styles.css +421 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridkitjs/theme-tailwind",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Tailwind v4 theme for GridKit — palette tokens, dark mode and grid styles.",
5
5
  "license": "MIT",
6
6
  "author": "Blagoja Blazhevski",
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,120 @@
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
+
502
+ /*
503
+ * A group's own subtotals, inline after its count — `gap` on the parent
504
+ * `.grid-group-cell-content` already spaces every child, this just keeps
505
+ * multiple aggregates readable as a list rather than running together.
506
+ */
507
+ .gridkit-data-grid .grid-group-row .group-aggregates {
508
+ display: flex;
509
+ gap: 0.75rem;
510
+ margin-inline-start: 0.5rem;
511
+ font-weight: 400;
512
+ }
513
+
514
+ .gridkit-data-grid .grid-group-row .group-aggregate {
515
+ color: var(--gridkit-fg-muted);
516
+ }
517
+
518
+ /*
519
+ * The grand-total footer, styled as the header's counterpart: same
520
+ * surface, same cell padding. No border by default, matching the
521
+ * header's own `.header-cell` — see the `borders-*` variants below for
522
+ * the opt-in top border that echoes the header's bottom one.
523
+ */
524
+ .gridkit-data-grid .grid-footer {
525
+ background-color: var(--gridkit-surface);
526
+ }
527
+
528
+ .gridkit-data-grid .grid-footer-cell {
529
+ padding: 0.5rem;
530
+ font-weight: 600;
531
+ }
532
+
533
+ /*
534
+ * A group's own summary row (`groupAggregateDisplay: "row"`) — the
535
+ * per-column-cell alternative to `.group-aggregates`' inline text.
536
+ * Shares the group header's muted surface so the pair read as one unit,
537
+ * but is presentational: no hover state, no pointer cursor, matching
538
+ * `GridGroupSummaryRow`'s own lack of any click/focus handling.
539
+ */
540
+ .gridkit-data-grid .grid-group-summary-row {
541
+ background-color: var(--gridkit-surface-muted);
542
+ }
543
+
544
+ .gridkit-data-grid .grid-group-summary-cell {
545
+ padding: 0.5rem;
546
+ font-weight: 600;
547
+ }
548
+
549
+ /*
550
+ * Indents only the first cell, matching how `GridGroupRow`'s own
551
+ * `paddingInlineStart` indents just the one spanning cell it has — an
552
+ * empty, `aria-hidden` inline spacer rather than padding on the `<td>`
553
+ * itself, so the cell's own content still aligns flush with the column
554
+ * above and below it once the indent's width is accounted for.
555
+ */
556
+ .gridkit-data-grid .grid-group-summary-indent {
557
+ display: inline-block;
558
+ }
559
+
411
560
  /*
412
561
  * Selection, after the hover rules so that a selected row hovered stays
413
562
  * selected — the two would otherwise be the same colour, since hover already
@@ -461,53 +610,316 @@
461
610
 
462
611
  /* Horizontal borders */
463
612
  .gridkit-data-grid.borders-horizontal .grid-header .header-cell,
464
- .gridkit-data-grid.borders-horizontal .grid-cell {
613
+ .gridkit-data-grid.borders-horizontal .grid-cell,
614
+ .gridkit-data-grid.borders-horizontal .grid-group-cell,
615
+ .gridkit-data-grid.borders-horizontal .grid-group-summary-cell {
465
616
  border-bottom: 1px solid var(--gridkit-line);
466
617
  }
467
618
 
619
+ /*
620
+ * The footer's own top border, echoing the header's bottom-anchored one —
621
+ * a `border-top` rather than a `border-bottom` on the last body row, since
622
+ * the footer sits in its own `<tfoot>` outside `<tbody>` entirely.
623
+ */
624
+ .gridkit-data-grid.borders-horizontal .grid-footer-cell,
625
+ .gridkit-data-grid.borders-all .grid-footer-cell {
626
+ border-top: 1px solid var(--gridkit-line);
627
+ }
628
+
468
629
  /*
469
630
  * The last row's bottom edge has no row below it to collapse with, so
470
631
  * unlike every internal boundary it is a genuinely extra pixel — the same
471
632
  * reason `borders-vertical` drops its `:last-child` border-right below.
633
+ * Matched against both row kinds: the last rendered row can just as well
634
+ * be a collapsed group header as a data row.
472
635
  */
473
- .gridkit-data-grid.borders-horizontal .grid-row:last-child .grid-cell {
636
+ .gridkit-data-grid.borders-horizontal .grid-row:last-child .grid-cell,
637
+ .gridkit-data-grid.borders-horizontal
638
+ .grid-group-row:last-child
639
+ .grid-group-cell,
640
+ .gridkit-data-grid.borders-horizontal
641
+ .grid-group-summary-row:last-child
642
+ .grid-group-summary-cell {
474
643
  border-bottom: none;
475
644
  }
476
645
 
477
646
  /* Vertical borders */
478
647
  .gridkit-data-grid.borders-vertical .grid-header .header-cell,
479
- .gridkit-data-grid.borders-vertical .grid-cell {
648
+ .gridkit-data-grid.borders-vertical .grid-cell,
649
+ .gridkit-data-grid.borders-vertical .grid-footer-cell,
650
+ .gridkit-data-grid.borders-vertical .grid-group-summary-cell {
480
651
  border-right: 1px solid var(--gridkit-line);
481
652
  }
482
653
 
483
654
  .gridkit-data-grid.borders-vertical .grid-header .header-cell:last-child,
484
- .gridkit-data-grid.borders-vertical .grid-cell:last-child {
655
+ .gridkit-data-grid.borders-vertical .grid-cell:last-child,
656
+ .gridkit-data-grid.borders-vertical .grid-footer-cell:last-child,
657
+ .gridkit-data-grid.borders-vertical .grid-group-summary-cell:last-child {
485
658
  border-right: none;
486
659
  }
487
660
 
488
661
  /* Borders on all sides */
489
662
  .gridkit-data-grid.borders-all .grid-header .header-cell,
490
- .gridkit-data-grid.borders-all .grid-cell {
663
+ .gridkit-data-grid.borders-all .grid-cell,
664
+ .gridkit-data-grid.borders-all .grid-group-cell,
665
+ .gridkit-data-grid.borders-all .grid-group-summary-cell {
491
666
  border-bottom: 1px solid var(--gridkit-line);
492
667
  border-right: 1px solid var(--gridkit-line);
493
668
  }
494
669
 
670
+ .gridkit-data-grid.borders-all .grid-footer-cell {
671
+ border-right: 1px solid var(--gridkit-line);
672
+ }
673
+
495
674
  /*
496
675
  * The outer left/right edges have no neighbouring cell to collapse with, so
497
676
  * 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.
677
+ * this the table would render 2px wider than the sum of its columns. A
678
+ * group cell is both its row's first and last child at once (it is the
679
+ * only cell), so it takes both exceptions.
499
680
  */
500
681
  .gridkit-data-grid.borders-all .grid-header .header-cell:first-child,
501
- .gridkit-data-grid.borders-all .grid-cell:first-child {
682
+ .gridkit-data-grid.borders-all .grid-cell:first-child,
683
+ .gridkit-data-grid.borders-all .grid-group-cell,
684
+ .gridkit-data-grid.borders-all .grid-footer-cell:first-child,
685
+ .gridkit-data-grid.borders-all .grid-group-summary-cell:first-child {
502
686
  border-left: none;
503
687
  }
504
688
 
505
689
  .gridkit-data-grid.borders-all .grid-header .header-cell:last-child,
506
- .gridkit-data-grid.borders-all .grid-cell:last-child {
690
+ .gridkit-data-grid.borders-all .grid-cell:last-child,
691
+ .gridkit-data-grid.borders-all .grid-group-cell,
692
+ .gridkit-data-grid.borders-all .grid-footer-cell:last-child,
693
+ .gridkit-data-grid.borders-all .grid-group-summary-cell:last-child {
507
694
  border-right: none;
508
695
  }
509
696
 
510
- .gridkit-data-grid.borders-all .grid-row:last-child .grid-cell {
697
+ .gridkit-data-grid.borders-all .grid-row:last-child .grid-cell,
698
+ .gridkit-data-grid.borders-all .grid-group-row:last-child .grid-group-cell,
699
+ .gridkit-data-grid.borders-all
700
+ .grid-group-summary-row:last-child
701
+ .grid-group-summary-cell {
511
702
  border-bottom: none;
512
703
  }
704
+
705
+ /*
706
+ * The group-by bar. A sibling of the table, not a row inside it — see
707
+ * `GroupByBar.tsx`'s own note on why — so it's unscoped by `.gridkit-data-grid`
708
+ * the way `.gridkit-sr-only` is.
709
+ */
710
+ .gridkit-group-by-bar {
711
+ display: flex;
712
+ flex-wrap: wrap;
713
+ align-items: center;
714
+ gap: 0.5rem;
715
+ padding: 0.5rem;
716
+ background-color: var(--gridkit-surface);
717
+ border-bottom: 1px solid var(--gridkit-line);
718
+ }
719
+
720
+ /*
721
+ * Drawn while a chip or an eligible header is being dragged — a dashed
722
+ * outline marking the bar itself as a valid drop zone, load-bearing when
723
+ * it's otherwise empty, with no chip of its own to show a drop indicator
724
+ * on. Where exactly the drop would land is the chips' own
725
+ * `is-drop-before`/`is-drop-after` marks; this outline doesn't also wash
726
+ * the bar's background once hovered — the marks are enough on their own.
727
+ */
728
+ .gridkit-group-by-bar.is-drag-target {
729
+ outline: 2px dashed var(--gridkit-accent);
730
+ outline-offset: -2px;
731
+ }
732
+
733
+ /*
734
+ * A header already in the group-by stack, dragged back toward it — never a
735
+ * valid drop, so no accent outline invites it: a muted dashed line in the
736
+ * same neutral tone as the grid's own borders, plus a `not-allowed` cursor
737
+ * for the pointer icon itself.
738
+ */
739
+ .gridkit-group-by-bar.is-drag-blocked {
740
+ cursor: not-allowed;
741
+ outline: 2px dashed var(--gridkit-line);
742
+ outline-offset: -2px;
743
+ }
744
+
745
+ .group-by-bar-placeholder {
746
+ font-size: 0.8125rem;
747
+ color: var(--gridkit-fg-muted);
748
+ }
749
+
750
+ .group-by-chip {
751
+ position: relative;
752
+ display: inline-flex;
753
+ align-items: center;
754
+ gap: 0.375rem;
755
+ padding: 0.25rem 0.5rem;
756
+ font-size: 0.8125rem;
757
+ color: var(--gridkit-fg);
758
+ background-color: var(--gridkit-selected);
759
+ border-radius: 9999px;
760
+ cursor: grab;
761
+ touch-action: none;
762
+ user-select: none;
763
+ }
764
+
765
+ .group-by-chip:focus-visible {
766
+ outline: 2px solid var(--gridkit-accent);
767
+ outline-offset: 1px;
768
+ }
769
+
770
+ .group-by-chip.is-dragging {
771
+ cursor: grabbing;
772
+ opacity: 0.5;
773
+ }
774
+
775
+ /*
776
+ * Where the chip would land. `.header-cell.is-drop-before`/`.is-drop-after`
777
+ * draw this as an inset line, but an inset line on a pill this round would
778
+ * be clipped by the chip's own `border-radius` into a curved sliver rather
779
+ * than a clean mark — so this is a `::before`/`::after` mark of its own
780
+ * instead, sitting in the gap beside the chip. Absolutely positioned and
781
+ * so out of flow, it never shifts the chip or its neighbors the way a
782
+ * change to border or padding would.
783
+ */
784
+ .group-by-chip.is-drop-before::before,
785
+ .group-by-chip.is-drop-after::after {
786
+ content: "";
787
+ position: absolute;
788
+ top: 0;
789
+ bottom: 0;
790
+ width: 2px;
791
+ border-radius: 1px;
792
+ background-color: var(--gridkit-accent);
793
+ }
794
+
795
+ .group-by-chip.is-drop-before::before {
796
+ left: calc(-0.25rem - 1px);
797
+ }
798
+
799
+ .group-by-chip.is-drop-after::after {
800
+ right: calc(-0.25rem - 1px);
801
+ }
802
+
803
+ /*
804
+ * The chip trailing the pointer mid-drag. Unlike the header's own
805
+ * `.gridkit-data-grid.drag-ghost` this can't share that compound selector
806
+ * — a chip ghost isn't part of the grid's own table — so it restates the
807
+ * positioning in full rather than only the parts that differ.
808
+ */
809
+ .group-by-chip.drag-ghost {
810
+ position: fixed;
811
+ top: 0;
812
+ left: 0;
813
+ z-index: 50;
814
+ border: 1px dashed var(--gridkit-accent);
815
+ opacity: 0.75;
816
+ pointer-events: none;
817
+ will-change: transform;
818
+ }
819
+
820
+ .group-by-chip-remove {
821
+ display: inline-flex;
822
+ align-items: center;
823
+ justify-content: center;
824
+ width: 1rem;
825
+ height: 1rem;
826
+ padding: 0;
827
+ line-height: 1;
828
+ color: inherit;
829
+ cursor: pointer;
830
+ background: none;
831
+ border: none;
832
+ }
833
+
834
+ .group-by-chip-remove:hover {
835
+ color: var(--gridkit-accent);
836
+ }
837
+
838
+ .group-by-chip-remove:focus-visible {
839
+ outline: 2px solid var(--gridkit-accent);
840
+ outline-offset: 1px;
841
+ }
842
+
843
+ /*
844
+ * The pager. A sibling of the table, not a row inside it — the same
845
+ * reasoning `.gridkit-group-by-bar` gives for its own placement — so it's
846
+ * unscoped by `.gridkit-data-grid` the way that bar is.
847
+ */
848
+ .gridkit-grid-pager {
849
+ display: flex;
850
+ flex-wrap: wrap;
851
+ align-items: center;
852
+ gap: 1rem;
853
+ padding: 0.5rem;
854
+ font-size: 0.8125rem;
855
+ color: var(--gridkit-fg);
856
+ background-color: var(--gridkit-surface);
857
+ border-top: 1px solid var(--gridkit-line);
858
+ }
859
+
860
+ .grid-pager-button {
861
+ padding: 0.25rem 0.625rem;
862
+ font-size: 0.8125rem;
863
+ color: var(--gridkit-fg);
864
+ cursor: pointer;
865
+ background-color: var(--gridkit-surface);
866
+ border: 1px solid var(--gridkit-line);
867
+ border-radius: 0.25rem;
868
+ }
869
+
870
+ .grid-pager-button:hover:not(:disabled) {
871
+ background-color: var(--gridkit-surface-muted);
872
+ }
873
+
874
+ .grid-pager-button:focus-visible {
875
+ outline: 2px solid var(--gridkit-accent);
876
+ outline-offset: 1px;
877
+ }
878
+
879
+ .grid-pager-button:disabled {
880
+ color: var(--gridkit-fg-muted);
881
+ cursor: default;
882
+ opacity: 0.5;
883
+ }
884
+
885
+ .grid-pager-button[aria-current="page"] {
886
+ color: var(--gridkit-fg);
887
+ background-color: var(--gridkit-selected-strong);
888
+ border-color: var(--gridkit-accent);
889
+ }
890
+
891
+ .grid-pager-button[aria-current="page"]:hover:not(:disabled) {
892
+ background-color: var(--gridkit-selected-strong);
893
+ }
894
+
895
+ .grid-pager-status {
896
+ color: var(--gridkit-fg-muted);
897
+ }
898
+
899
+ .grid-pager-ellipsis {
900
+ padding: 0.25rem 0.625rem;
901
+ font-size: 0.8125rem;
902
+ color: var(--gridkit-fg-muted);
903
+ }
904
+
905
+ .grid-pager-page-size {
906
+ display: inline-flex;
907
+ align-items: center;
908
+ gap: 0.375rem;
909
+ margin-inline-start: auto;
910
+ color: var(--gridkit-fg-muted);
911
+ }
912
+
913
+ .grid-pager-page-size select {
914
+ padding: 0.125rem 0.375rem;
915
+ color: var(--gridkit-fg);
916
+ background-color: var(--gridkit-surface);
917
+ border: 1px solid var(--gridkit-line);
918
+ border-radius: 0.25rem;
919
+ }
920
+
921
+ .grid-pager-page-size select:focus-visible {
922
+ outline: 2px solid var(--gridkit-accent);
923
+ outline-offset: 1px;
924
+ }
513
925
  }