@kanunilabs/pivotgrid 1.2.2 → 1.4.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 (45) hide show
  1. package/README.md +2 -2
  2. package/dist/index.cjs +3 -3
  3. package/dist/index.d.cts +20 -2
  4. package/dist/index.d.ts +20 -2
  5. package/dist/index.js +3 -3
  6. package/dist/pivotgrid.umd.js +11 -11
  7. package/dist/styles.css +199 -15
  8. package/dist/themes/all.css +1064 -0
  9. package/dist/themes/amber.css +28 -0
  10. package/dist/themes/aubergine.css +32 -0
  11. package/dist/themes/azure.css +28 -0
  12. package/dist/themes/burgundy.css +32 -0
  13. package/dist/themes/charcoal.css +32 -0
  14. package/dist/themes/contrast-dark.css +32 -0
  15. package/dist/themes/contrast-light.css +28 -0
  16. package/dist/themes/coral.css +28 -0
  17. package/dist/themes/corporate.css +28 -0
  18. package/dist/themes/deep-sea.css +32 -0
  19. package/dist/themes/editorial.css +28 -0
  20. package/dist/themes/ember.css +32 -0
  21. package/dist/themes/emerald.css +28 -0
  22. package/dist/themes/forest.css +32 -0
  23. package/dist/themes/glacier.css +28 -0
  24. package/dist/themes/graphite.css +32 -0
  25. package/dist/themes/indigo-night.css +32 -0
  26. package/dist/themes/indigo.css +28 -0
  27. package/dist/themes/ivory.css +28 -0
  28. package/dist/themes/lagoon.css +28 -0
  29. package/dist/themes/linen.css +28 -0
  30. package/dist/themes/midnight.css +32 -0
  31. package/dist/themes/mist.css +28 -0
  32. package/dist/themes/monochrome.css +28 -0
  33. package/dist/themes/onyx.css +32 -0
  34. package/dist/themes/orchid.css +28 -0
  35. package/dist/themes/porcelain.css +28 -0
  36. package/dist/themes/rose.css +28 -0
  37. package/dist/themes/sandstone.css +28 -0
  38. package/dist/themes/slate-night.css +32 -0
  39. package/dist/themes/slate.css +28 -0
  40. package/dist/themes/steel.css +32 -0
  41. package/dist/themes/stone.css +28 -0
  42. package/dist/themes/taupe.css +28 -0
  43. package/dist/themes/teal.css +28 -0
  44. package/dist/themes/terminal.css +32 -0
  45. package/package.json +6 -4
package/dist/styles.css CHANGED
@@ -32,6 +32,22 @@
32
32
  --pivot-warning: #f59e0b; /* amber-500 */
33
33
  --pivot-info: #3b82f6; /* blue-500 */
34
34
 
35
+ /* The column-header band (the column captions over the data). It follows
36
+ --pivot-surface-header — the panels: filter area, area zones, footer —
37
+ unless something sets it alone; a colour scheme with an ink header band
38
+ does exactly that and keeps the panels light. */
39
+ --pivot-header-bg: var(--pivot-surface-header);
40
+ /* Its text. Follows --pivot-text-header (a theme object's `textHeader`) unless
41
+ set alone — a colour scheme sets it to the band's light ink and leaves
42
+ --pivot-text-header dark for the panels that also read it (the import
43
+ preview's column captions sit on the light panel colour). */
44
+ --pivot-header-text: var(--pivot-text-header, var(--pivot-text));
45
+ /* A stronger rule than --pivot-border (window resize grips). */
46
+ --pivot-border-strong: #94a3b8; /* slate-400 */
47
+ /* accent-color of the native checkboxes and radios. `auto` is the browser's
48
+ own, i.e. what they always looked like; a colour scheme sets its accent. */
49
+ --pivot-control-accent: auto;
50
+
35
51
  /* ─────────────────────────────────────────────────────────
36
52
  Spacing Tokens (Base 4px system)
37
53
  ───────────────────────────────────────────────────────── */
@@ -59,6 +75,8 @@
59
75
  Structural Tokens
60
76
  ───────────────────────────────────────────────────────── */
61
77
  --pivot-overlay-bg: rgba(0, 0, 0, 0.5);
78
+ /* The field chooser's lighter backdrop (it stays open beside the grid). */
79
+ --pivot-chooser-overlay-bg: rgba(0, 0, 0, 0.4);
62
80
  --pivot-modal-bg: var(--pivot-surface);
63
81
 
64
82
  /* Unified Shadow System */
@@ -67,6 +85,10 @@
67
85
  --pivot-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
68
86
  --pivot-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
69
87
  --pivot-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
88
+ /* A pressed toolbar toggle. */
89
+ --pivot-shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
90
+ /* Dropdown menus (field and view menus). */
91
+ --pivot-shadow-menu: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02);
70
92
 
71
93
  /* Unified Border Radius System */
72
94
  --pivot-radius-none: 0px;
@@ -263,6 +285,14 @@
263
285
  background-color: color-mix(in srgb, var(--pivot-border) 40%, var(--pivot-surface));
264
286
  }
265
287
 
288
+ /* Native checkboxes and radios follow the theme's accent when one is set
289
+ (--pivot-control-accent defaults to `auto`, the browser's own colour). An
290
+ inline accentColor (the calculated-field dialog's radios) still wins. */
291
+ .kanuni-pivot-root input[type='checkbox'],
292
+ .kanuni-pivot-root input[type='radio'] {
293
+ accent-color: var(--pivot-control-accent);
294
+ }
295
+
266
296
  /* Focus State */
267
297
  .pivot-state-focus:focus-visible {
268
298
  outline: 2px solid var(--pivot-primary);
@@ -404,6 +434,43 @@
404
434
  color: var(--pivot-text-header, var(--pivot-text));
405
435
  }
406
436
 
437
+ /* ── Density ──────────────────────────────────────────────────
438
+ `density` puts kanuni-pivot-density-compact / -comfortable on the grid root
439
+ (`normal` and unset add nothing, so the rules above ARE normal). The row
440
+ HEIGHT is not set here: the virtualizer runs on it, so it lives in core
441
+ (`pivotRowHeight`: 24 / 28 / 36) and the renderers paint each row at it.
442
+ What CSS owns has to agree with that number, or the frozen row headers drift
443
+ away from their data rows: a body cell's line box is the row height minus
444
+ its 1px bottom border, a header cell's is that minus 8px of inline vertical
445
+ padding (see the two rules above). Compact also steps the type down a size;
446
+ the popups and dialogs keep their own sizes in every density. */
447
+ .kanuni-pivot-root.kanuni-pivot-density-compact {
448
+ --pivot-text-base: 13px;
449
+ --pivot-text-sm: 12px;
450
+ }
451
+ .kanuni-pivot-density-compact .kanuni-pivot-table .kanuni-pivot-cell {
452
+ line-height: 23px;
453
+ }
454
+ .kanuni-pivot-density-compact .kanuni-pivot-table .kanuni-pivot-header-cell {
455
+ line-height: 15px;
456
+ }
457
+ .kanuni-pivot-density-comfortable .kanuni-pivot-table .kanuni-pivot-cell {
458
+ line-height: 35px;
459
+ }
460
+ .kanuni-pivot-density-comfortable .kanuni-pivot-table .kanuni-pivot-header-cell {
461
+ line-height: 27px;
462
+ }
463
+ /* The field chips in the header corner inherit the header cell's line
464
+ height, so the rules above would resize them — and, chips having
465
+ `transition: all`, animate them for 0.2s after a switch. The pane-balancing
466
+ code in the React body measured the frozen header mid-animation and the two
467
+ panes ended 0.06-0.3px apart (tree layout, 2026-10-11; exact with this
468
+ rule). The chips keep their normal metrics in every density. */
469
+ .kanuni-pivot-density-compact .kanuni-pivot-table .kanuni-pivot-header-cell .kanuni-pivot-field-chip,
470
+ .kanuni-pivot-density-comfortable .kanuni-pivot-table .kanuni-pivot-header-cell .kanuni-pivot-field-chip {
471
+ line-height: 19px;
472
+ }
473
+
407
474
  /* Row header cells */
408
475
  .kanuni-pivot-table .kanuni-pivot-row-header {
409
476
  font-size: var(--pivot-text-sm);
@@ -500,6 +567,29 @@
500
567
  font-weight: 600 !important;
501
568
  }
502
569
 
570
+ /* The column-header band reads --pivot-header-bg. Both renderers paint the
571
+ header cells with an inline `var(--pivot-surface-header)`; redefining that
572
+ variable ON the cell points it at the band colour without touching the
573
+ inline style (or what onCellPrepared sees), while the area-zone row above
574
+ it — the same thead, a different cell — keeps the panel colour. */
575
+ .kanuni-pivot-table thead .kanuni-pivot-header-cell {
576
+ --pivot-surface-header: var(--pivot-header-bg);
577
+ --pivot-text-header: var(--pivot-header-text);
578
+ }
579
+
580
+ /* The corner and the grand-total column header sit on surface-derived fills
581
+ (the two !important rules above), not on the header band, so they take the
582
+ body text colour. With an ink band (light --pivot-text-header) they were
583
+ light-on-light; without one --pivot-text-header falls back to --pivot-text
584
+ anyway, so the default look is unchanged. */
585
+ /* (The `thead` twins match the band rule's specificity and, coming later, win.) */
586
+ .kanuni-pivot-table .kanuni-pivot-header-corner,
587
+ .kanuni-pivot-table .kanuni-pivot-header-total,
588
+ .kanuni-pivot-table thead .kanuni-pivot-header-corner,
589
+ .kanuni-pivot-table thead .kanuni-pivot-header-total {
590
+ --pivot-text-header: var(--pivot-text);
591
+ }
592
+
503
593
  /* Focused cell */
504
594
  /* Focused/selected blends are mixed over the SURFACE, not over transparent.
505
595
  In the React two-pane layout the transparent blend always landed on a
@@ -563,7 +653,7 @@
563
653
  .kanuni-pivot-report-btn--open {
564
654
  background-color: var(--pivot-primary);
565
655
  color: var(--pivot-primary-foreground);
566
- box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
656
+ box-shadow: var(--pivot-shadow-inset);
567
657
  }
568
658
  .kanuni-pivot-report-btn--active {
569
659
  background-color: color-mix(in srgb, var(--pivot-primary) 10%, transparent);
@@ -711,10 +801,17 @@
711
801
  gap: 16px;
712
802
  }
713
803
 
804
+ /* One row: the title block, then ×. Every dialog's header holds exactly that
805
+ pair; a column put the × UNDER the title (Field Settings and Condition
806
+ Filter in both renderers, the plain JS drill-down, prefilter and
807
+ calculated-field designers), and the rest carried an inline
808
+ `flex-direction: row` to undo it (§6d-18). */
714
809
  .kanuni-pivot-modal-header {
715
810
  display: flex;
716
- flex-direction: column;
717
- gap: 6px;
811
+ flex-direction: row;
812
+ align-items: center;
813
+ justify-content: space-between;
814
+ gap: 12px;
718
815
  }
719
816
 
720
817
  .kanuni-pivot-modal-title {
@@ -724,6 +821,7 @@
724
821
  display: flex;
725
822
  justify-content: space-between;
726
823
  align-items: center;
824
+ min-width: 0;
727
825
  }
728
826
 
729
827
  .kanuni-pivot-modal-close {
@@ -736,7 +834,10 @@
736
834
  background-color: var(--pivot-surface-hover);
737
835
  }
738
836
 
739
- .kanuni-pivot-modal-desc {
837
+ /* `-description` and `-form-label` are the names the dialogs actually use
838
+ (both renderers); only the short names had rules, so neither was styled. */
839
+ .kanuni-pivot-modal-desc,
840
+ .kanuni-pivot-modal-description {
740
841
  font-size: 14px;
741
842
  color: var(--pivot-text-muted);
742
843
  }
@@ -747,7 +848,14 @@
747
848
  gap: 8px;
748
849
  }
749
850
 
750
- .kanuni-pivot-label {
851
+ /* Room between a dialog's form rows — they sat flush. Only form groups: the
852
+ import and drill-down bodies space their own content. */
853
+ .kanuni-pivot-modal-body > .kanuni-pivot-form-group + .kanuni-pivot-form-group {
854
+ margin-top: 16px;
855
+ }
856
+
857
+ .kanuni-pivot-label,
858
+ .kanuni-pivot-form-label {
751
859
  font-size: 14px;
752
860
  font-weight: 500;
753
861
  color: var(--pivot-text);
@@ -770,6 +878,32 @@
770
878
  box-shadow: 0 0 0 1px var(--pivot-primary);
771
879
  }
772
880
 
881
+ /* The input's twin. It had no rule at all, so selects rendered borderless.
882
+ Root-qualified because `.kanuni-pivot-root select` (0,1,1) resets the
883
+ background and font; an opaque surface background also keeps the native
884
+ option list readable under a dark theme. */
885
+ .kanuni-pivot-root .kanuni-pivot-select {
886
+ width: 100%;
887
+ height: 36px;
888
+ padding: 4px 8px;
889
+ border-radius: var(--pivot-border-radius);
890
+ border: 1px solid var(--pivot-border);
891
+ background-color: var(--pivot-surface);
892
+ color: var(--pivot-text);
893
+ font-size: 14px;
894
+ cursor: pointer;
895
+ transition: border-color 0.15s, box-shadow 0.15s;
896
+ }
897
+ .kanuni-pivot-root .kanuni-pivot-select:focus {
898
+ outline: none;
899
+ border-color: var(--pivot-primary);
900
+ box-shadow: 0 0 0 1px var(--pivot-primary);
901
+ }
902
+ .kanuni-pivot-root .kanuni-pivot-select:disabled {
903
+ opacity: 0.5;
904
+ cursor: not-allowed;
905
+ }
906
+
773
907
  .kanuni-pivot-checkbox-group {
774
908
  display: flex;
775
909
  align-items: center;
@@ -830,10 +964,54 @@
830
964
  background-color: var(--pivot-primary-hover);
831
965
  }
832
966
 
967
+ /* ── What the element resets take away, restated one class stronger ──
968
+ `.kanuni-pivot-root button` / `select` / `h2, h3, p` (and the
969
+ `.kanuni-pivot-portal-root` twins) are (0,1,1); a lone class is (0,1,0) and
970
+ loses. So every --primary / --outline button rendered as bare text with no
971
+ background, border or padding ("Cancel ✓ OK do not look like buttons"),
972
+ the × lost its hit area and dialog titles their weight (§6d-18). Only the
973
+ properties a reset clobbers are repeated here; hover rules are (0,3,0) and
974
+ still win. A bare `.kanuni-pivot-btn` is left as it was: the chart
975
+ toolbars rely on it staying unstyled. */
976
+ .kanuni-pivot-root .kanuni-pivot-btn--outline,
977
+ .kanuni-pivot-root .kanuni-pivot-btn--primary {
978
+ padding: 0 16px;
979
+ font-size: 14px;
980
+ font-weight: 500;
981
+ }
982
+ .kanuni-pivot-root .kanuni-pivot-btn--outline {
983
+ background-color: transparent;
984
+ border: 1px solid var(--pivot-border);
985
+ color: var(--pivot-text);
986
+ }
987
+ .kanuni-pivot-root .kanuni-pivot-btn--primary {
988
+ background-color: var(--pivot-primary);
989
+ border: 1px solid var(--pivot-primary);
990
+ color: var(--pivot-primary-foreground);
991
+ }
992
+ .kanuni-pivot-root .kanuni-pivot-modal-close {
993
+ display: inline-flex;
994
+ align-items: center;
995
+ justify-content: center;
996
+ flex-shrink: 0;
997
+ padding: 6px;
998
+ }
999
+ .kanuni-pivot-root .kanuni-pivot-modal-title {
1000
+ font-weight: 600;
1001
+ }
1002
+ .kanuni-pivot-root .kanuni-pivot-modal-desc,
1003
+ .kanuni-pivot-root .kanuni-pivot-modal-description {
1004
+ color: var(--pivot-text-muted);
1005
+ }
1006
+
833
1007
  /* ─────────────────────────────────────────────────────────────
834
1008
  Footer / Toolbar Styles
835
1009
  ───────────────────────────────────────────────────────────── */
836
- .kanuni-pivot-footer-btn {
1010
+ /* Root-qualified (0,2,0): `.kanuni-pivot-root button` (0,1,1) resets padding
1011
+ and border on every button, and from that reset until 2026-10-11 these icons
1012
+ painted bare — 15px targets with no padding and no hover border, though the
1013
+ touch note below measured 27px when it was written. */
1014
+ .kanuni-pivot-root .kanuni-pivot-footer-btn {
837
1015
  padding: 6px;
838
1016
  border-radius: var(--pivot-border-radius);
839
1017
  color: var(--pivot-text-muted);
@@ -844,6 +1022,14 @@
844
1022
  align-items: center;
845
1023
  justify-content: center;
846
1024
  }
1025
+ /* Density steps the targets with the rows: 23 / 27 / 31px. Same specificity
1026
+ as the rule above and later in the file, so they win. */
1027
+ .kanuni-pivot-density-compact .kanuni-pivot-footer-btn {
1028
+ padding: 4px;
1029
+ }
1030
+ .kanuni-pivot-density-comfortable .kanuni-pivot-footer-btn {
1031
+ padding: 8px;
1032
+ }
847
1033
  .kanuni-pivot-footer-btn:hover {
848
1034
  color: var(--pivot-text);
849
1035
  background-color: var(--pivot-surface);
@@ -855,7 +1041,7 @@
855
1041
  .kanuni-pivot-footer-btn--active {
856
1042
  background-color: var(--pivot-primary);
857
1043
  color: var(--pivot-primary-foreground);
858
- box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
1044
+ box-shadow: var(--pivot-shadow-inset);
859
1045
  }
860
1046
 
861
1047
  /* ── Touch targets ────────────────────────────────────────────
@@ -1030,6 +1216,11 @@
1030
1216
  color: var(--pivot-danger);
1031
1217
  }
1032
1218
 
1219
+ /* The field chooser's backdrop (both renderers). */
1220
+ .kanuni-pivot-chooser-backdrop {
1221
+ background-color: var(--pivot-chooser-overlay-bg);
1222
+ }
1223
+
1033
1224
  /* ─────────────────────────────────────────────────────────────
1034
1225
  Filter Popup Styles
1035
1226
  ───────────────────────────────────────────────────────────── */
@@ -1037,7 +1228,7 @@
1037
1228
  position: absolute;
1038
1229
  background-color: var(--pivot-surface);
1039
1230
  border: 1px solid var(--pivot-border);
1040
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02);
1231
+ box-shadow: var(--pivot-shadow-menu);
1041
1232
  border-radius: var(--pivot-radius-lg);
1042
1233
  padding: 8px;
1043
1234
  z-index: 1000;
@@ -1393,7 +1584,6 @@
1393
1584
  @layer theme, components, utilities;
1394
1585
  @layer theme {
1395
1586
  :root, :host {
1396
- --color-black: #000;
1397
1587
  --spacing: 0.25rem;
1398
1588
  --text-xs: 0.75rem;
1399
1589
  --text-xs--line-height: calc(1 / 0.75);
@@ -1727,12 +1917,6 @@
1727
1917
  .kanuni-pivot-root .border-primary {
1728
1918
  border-color: var(--pivot-primary);
1729
1919
  }
1730
- .kanuni-pivot-root .bg-black\/40 {
1731
- background-color: color-mix(in srgb, #000 40%, transparent);
1732
- @supports (color: color-mix(in lab, red, red)) {
1733
- background-color: color-mix(in oklab, var(--color-black) 40%, transparent);
1734
- }
1735
- }
1736
1920
  .kanuni-pivot-root .bg-surface {
1737
1921
  background-color: var(--pivot-surface);
1738
1922
  }