@gridkitjs/theme-tailwind 0.5.0 → 0.7.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 +230 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridkitjs/theme-tailwind",
3
- "version": "0.5.0",
3
+ "version": "0.7.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
@@ -120,12 +120,34 @@
120
120
  @layer base {
121
121
  /*
122
122
  * The table is exactly as wide as its columns, so anything wider than the
123
- * space available scrolls here rather than squashing the columns.
123
+ * space available scrolls here rather than squashing the columns. Scrolls
124
+ * the header, body, and footer tables together, since all three are
125
+ * descendants of this one viewport.
124
126
  */
125
127
  .gridkit-data-grid-viewport {
126
128
  overflow-x: auto;
127
129
  }
128
130
 
131
+ /*
132
+ * The row area alone. `height` unset leaves this `auto` — exactly the
133
+ * content-driven height the single-table layout had before the
134
+ * header/body/footer split — and a consumer-set `height` bounds only this
135
+ * div, so the group-by bar, header, footer, and pager stay outside it and
136
+ * always visible while the rows scroll independently.
137
+ *
138
+ * No `position: sticky` here or anywhere else in this file for the header/
139
+ * footer: they don't need it. Splitting header, body, and footer into
140
+ * sibling `<table>`s already keeps the header and footer out of the region
141
+ * that scrolls — there's nothing to "stick," since they were never going
142
+ * to scroll away. A consumer wanting a divider or shadow at the seam adds
143
+ * their own CSS targeting `.gridkit-data-grid-header`/
144
+ * `.gridkit-data-grid-footer`.
145
+ */
146
+ .gridkit-data-grid-body {
147
+ overflow-y: auto;
148
+ height: var(--gridkit-body-height, auto);
149
+ }
150
+
129
151
  /*
130
152
  * Read but not seen — the grid's live region, which reports a reorder or a
131
153
  * resize that only a sighted user could otherwise notice.
@@ -499,6 +521,75 @@
499
521
  color: var(--gridkit-fg-muted);
500
522
  }
501
523
 
524
+ /*
525
+ * A group's own subtotals, inline after its count — `gap` on the parent
526
+ * `.grid-group-cell-content` already spaces every child, this just keeps
527
+ * multiple aggregates readable as a list rather than running together.
528
+ */
529
+ .gridkit-data-grid .grid-group-row .group-aggregates {
530
+ display: flex;
531
+ gap: 0.75rem;
532
+ margin-inline-start: 0.5rem;
533
+ font-weight: 400;
534
+ }
535
+
536
+ .gridkit-data-grid .grid-group-row .group-aggregate {
537
+ color: var(--gridkit-fg-muted);
538
+ }
539
+
540
+ /*
541
+ * The grand-total footer, styled as the header's counterpart: same
542
+ * surface, same cell padding. No border by default, matching the
543
+ * header's own `.header-cell` — see the `borders-*` variants below for
544
+ * the opt-in top border that echoes the header's bottom one.
545
+ */
546
+ .gridkit-data-grid .grid-footer {
547
+ background-color: var(--gridkit-surface);
548
+ }
549
+
550
+ .gridkit-data-grid .grid-footer-cell {
551
+ padding: 0.5rem;
552
+ font-weight: 600;
553
+ }
554
+
555
+ /*
556
+ * A group's own summary row (`groupAggregateDisplay: "row"`) — the
557
+ * per-column-cell alternative to `.group-aggregates`' inline text.
558
+ * Shares the group header's muted surface so the pair read as one unit,
559
+ * but is presentational: no hover state, no pointer cursor, matching
560
+ * `GridGroupSummaryRow`'s own lack of any click/focus handling.
561
+ */
562
+ .gridkit-data-grid .grid-group-summary-row {
563
+ background-color: var(--gridkit-surface-muted);
564
+ }
565
+
566
+ .gridkit-data-grid .grid-group-summary-cell {
567
+ padding: 0.5rem;
568
+ font-weight: 600;
569
+ }
570
+
571
+ /*
572
+ * `infiniteScroll`'s built-in loading row — aria-hidden and outside
573
+ * `aria-rowcount` (see `GridBody`), so this is a purely visual cue, not an
574
+ * announced one.
575
+ */
576
+ .gridkit-data-grid .grid-loading-cell {
577
+ padding: 0.5rem;
578
+ color: var(--gridkit-fg-muted);
579
+ text-align: center;
580
+ }
581
+
582
+ /*
583
+ * Indents only the first cell, matching how `GridGroupRow`'s own
584
+ * `paddingInlineStart` indents just the one spanning cell it has — an
585
+ * empty, `aria-hidden` inline spacer rather than padding on the `<td>`
586
+ * itself, so the cell's own content still aligns flush with the column
587
+ * above and below it once the indent's width is accounted for.
588
+ */
589
+ .gridkit-data-grid .grid-group-summary-indent {
590
+ display: inline-block;
591
+ }
592
+
502
593
  /*
503
594
  * Selection, after the hover rules so that a selected row hovered stays
504
595
  * selected — the two would otherwise be the same colour, since hover already
@@ -550,13 +641,40 @@
550
641
  user-select: none;
551
642
  }
552
643
 
553
- /* Horizontal borders */
644
+ /*
645
+ * Horizontal borders.
646
+ *
647
+ * Header, body, and footer are three separate `<table>`s, so
648
+ * `border-collapse` only ever merges borders within one of them — it
649
+ * cannot merge a header border against a body border the way it would
650
+ * merge two adjacent body rows' borders in one shared `<tbody>`. Each seam
651
+ * below is therefore deliberately defined from one side only, never both,
652
+ * or the two tables' independent borders would render as a doubled line
653
+ * instead of collapsing into one:
654
+ * - header/body seam: the header's own `border-bottom` here. The body's
655
+ * first row never sets a `border-top` of its own.
656
+ * - body/footer seam: the footer's own `border-top` (below, alongside
657
+ * `.grid-footer-cell`). The body's last row has its `border-bottom`
658
+ * stripped (below, `.grid-row:last-child`) specifically so it never
659
+ * supplies the other half of this seam.
660
+ */
554
661
  .gridkit-data-grid.borders-horizontal .grid-header .header-cell,
555
662
  .gridkit-data-grid.borders-horizontal .grid-cell,
556
- .gridkit-data-grid.borders-horizontal .grid-group-cell {
663
+ .gridkit-data-grid.borders-horizontal .grid-group-cell,
664
+ .gridkit-data-grid.borders-horizontal .grid-group-summary-cell {
557
665
  border-bottom: 1px solid var(--gridkit-line);
558
666
  }
559
667
 
668
+ /*
669
+ * The footer's own top border, echoing the header's bottom-anchored one —
670
+ * a `border-top` rather than a `border-bottom` on the last body row, since
671
+ * the footer sits in its own `<table>` entirely, sibling to the body's.
672
+ */
673
+ .gridkit-data-grid.borders-horizontal .grid-footer-cell,
674
+ .gridkit-data-grid.borders-all .grid-footer-cell {
675
+ border-top: 1px solid var(--gridkit-line);
676
+ }
677
+
560
678
  /*
561
679
  * The last row's bottom edge has no row below it to collapse with, so
562
680
  * unlike every internal boundary it is a genuinely extra pixel — the same
@@ -567,29 +685,41 @@
567
685
  .gridkit-data-grid.borders-horizontal .grid-row:last-child .grid-cell,
568
686
  .gridkit-data-grid.borders-horizontal
569
687
  .grid-group-row:last-child
570
- .grid-group-cell {
688
+ .grid-group-cell,
689
+ .gridkit-data-grid.borders-horizontal
690
+ .grid-group-summary-row:last-child
691
+ .grid-group-summary-cell {
571
692
  border-bottom: none;
572
693
  }
573
694
 
574
695
  /* Vertical borders */
575
696
  .gridkit-data-grid.borders-vertical .grid-header .header-cell,
576
- .gridkit-data-grid.borders-vertical .grid-cell {
697
+ .gridkit-data-grid.borders-vertical .grid-cell,
698
+ .gridkit-data-grid.borders-vertical .grid-footer-cell,
699
+ .gridkit-data-grid.borders-vertical .grid-group-summary-cell {
577
700
  border-right: 1px solid var(--gridkit-line);
578
701
  }
579
702
 
580
703
  .gridkit-data-grid.borders-vertical .grid-header .header-cell:last-child,
581
- .gridkit-data-grid.borders-vertical .grid-cell:last-child {
704
+ .gridkit-data-grid.borders-vertical .grid-cell:last-child,
705
+ .gridkit-data-grid.borders-vertical .grid-footer-cell:last-child,
706
+ .gridkit-data-grid.borders-vertical .grid-group-summary-cell:last-child {
582
707
  border-right: none;
583
708
  }
584
709
 
585
710
  /* Borders on all sides */
586
711
  .gridkit-data-grid.borders-all .grid-header .header-cell,
587
712
  .gridkit-data-grid.borders-all .grid-cell,
588
- .gridkit-data-grid.borders-all .grid-group-cell {
713
+ .gridkit-data-grid.borders-all .grid-group-cell,
714
+ .gridkit-data-grid.borders-all .grid-group-summary-cell {
589
715
  border-bottom: 1px solid var(--gridkit-line);
590
716
  border-right: 1px solid var(--gridkit-line);
591
717
  }
592
718
 
719
+ .gridkit-data-grid.borders-all .grid-footer-cell {
720
+ border-right: 1px solid var(--gridkit-line);
721
+ }
722
+
593
723
  /*
594
724
  * The outer left/right edges have no neighbouring cell to collapse with, so
595
725
  * unlike every internal boundary they are a genuinely extra pixel — without
@@ -599,18 +729,25 @@
599
729
  */
600
730
  .gridkit-data-grid.borders-all .grid-header .header-cell:first-child,
601
731
  .gridkit-data-grid.borders-all .grid-cell:first-child,
602
- .gridkit-data-grid.borders-all .grid-group-cell {
732
+ .gridkit-data-grid.borders-all .grid-group-cell,
733
+ .gridkit-data-grid.borders-all .grid-footer-cell:first-child,
734
+ .gridkit-data-grid.borders-all .grid-group-summary-cell:first-child {
603
735
  border-left: none;
604
736
  }
605
737
 
606
738
  .gridkit-data-grid.borders-all .grid-header .header-cell:last-child,
607
739
  .gridkit-data-grid.borders-all .grid-cell:last-child,
608
- .gridkit-data-grid.borders-all .grid-group-cell {
740
+ .gridkit-data-grid.borders-all .grid-group-cell,
741
+ .gridkit-data-grid.borders-all .grid-footer-cell:last-child,
742
+ .gridkit-data-grid.borders-all .grid-group-summary-cell:last-child {
609
743
  border-right: none;
610
744
  }
611
745
 
612
746
  .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 {
747
+ .gridkit-data-grid.borders-all .grid-group-row:last-child .grid-group-cell,
748
+ .gridkit-data-grid.borders-all
749
+ .grid-group-summary-row:last-child
750
+ .grid-group-summary-cell {
614
751
  border-bottom: none;
615
752
  }
616
753
 
@@ -751,4 +888,87 @@
751
888
  outline: 2px solid var(--gridkit-accent);
752
889
  outline-offset: 1px;
753
890
  }
891
+
892
+ /*
893
+ * The pager. A sibling of the table, not a row inside it — the same
894
+ * reasoning `.gridkit-group-by-bar` gives for its own placement — so it's
895
+ * unscoped by `.gridkit-data-grid` the way that bar is.
896
+ */
897
+ .gridkit-grid-pager {
898
+ display: flex;
899
+ flex-wrap: wrap;
900
+ align-items: center;
901
+ gap: 1rem;
902
+ padding: 0.5rem;
903
+ font-size: 0.8125rem;
904
+ color: var(--gridkit-fg);
905
+ background-color: var(--gridkit-surface);
906
+ border-top: 1px solid var(--gridkit-line);
907
+ }
908
+
909
+ .grid-pager-button {
910
+ padding: 0.25rem 0.625rem;
911
+ font-size: 0.8125rem;
912
+ color: var(--gridkit-fg);
913
+ cursor: pointer;
914
+ background-color: var(--gridkit-surface);
915
+ border: 1px solid var(--gridkit-line);
916
+ border-radius: 0.25rem;
917
+ }
918
+
919
+ .grid-pager-button:hover:not(:disabled) {
920
+ background-color: var(--gridkit-surface-muted);
921
+ }
922
+
923
+ .grid-pager-button:focus-visible {
924
+ outline: 2px solid var(--gridkit-accent);
925
+ outline-offset: 1px;
926
+ }
927
+
928
+ .grid-pager-button:disabled {
929
+ color: var(--gridkit-fg-muted);
930
+ cursor: default;
931
+ opacity: 0.5;
932
+ }
933
+
934
+ .grid-pager-button[aria-current="page"] {
935
+ color: var(--gridkit-fg);
936
+ background-color: var(--gridkit-selected-strong);
937
+ border-color: var(--gridkit-accent);
938
+ }
939
+
940
+ .grid-pager-button[aria-current="page"]:hover:not(:disabled) {
941
+ background-color: var(--gridkit-selected-strong);
942
+ }
943
+
944
+ .grid-pager-status {
945
+ color: var(--gridkit-fg-muted);
946
+ }
947
+
948
+ .grid-pager-ellipsis {
949
+ padding: 0.25rem 0.625rem;
950
+ font-size: 0.8125rem;
951
+ color: var(--gridkit-fg-muted);
952
+ }
953
+
954
+ .grid-pager-page-size {
955
+ display: inline-flex;
956
+ align-items: center;
957
+ gap: 0.375rem;
958
+ margin-inline-start: auto;
959
+ color: var(--gridkit-fg-muted);
960
+ }
961
+
962
+ .grid-pager-page-size select {
963
+ padding: 0.125rem 0.375rem;
964
+ color: var(--gridkit-fg);
965
+ background-color: var(--gridkit-surface);
966
+ border: 1px solid var(--gridkit-line);
967
+ border-radius: 0.25rem;
968
+ }
969
+
970
+ .grid-pager-page-size select:focus-visible {
971
+ outline: 2px solid var(--gridkit-accent);
972
+ outline-offset: 1px;
973
+ }
754
974
  }