diff --git a/docs/assets/screenshots/add-menu-dark.png b/docs/assets/screenshots/add-menu-dark.png index be076be1..e926f83c 100644 Binary files a/docs/assets/screenshots/add-menu-dark.png and b/docs/assets/screenshots/add-menu-dark.png differ diff --git a/docs/assets/screenshots/add-menu-light.png b/docs/assets/screenshots/add-menu-light.png index b4aed476..7f118281 100644 Binary files a/docs/assets/screenshots/add-menu-light.png and b/docs/assets/screenshots/add-menu-light.png differ diff --git a/docs/assets/screenshots/add-to-filters-dark.png b/docs/assets/screenshots/add-to-filters-dark.png index 08a6c11d..43271333 100644 Binary files a/docs/assets/screenshots/add-to-filters-dark.png and b/docs/assets/screenshots/add-to-filters-dark.png differ diff --git a/docs/assets/screenshots/add-to-filters-light.png b/docs/assets/screenshots/add-to-filters-light.png index f90b13c8..50e19fa2 100644 Binary files a/docs/assets/screenshots/add-to-filters-light.png and b/docs/assets/screenshots/add-to-filters-light.png differ diff --git a/docs/assets/screenshots/chart-combo-dark.png b/docs/assets/screenshots/chart-combo-dark.png index 6754fb83..0f207188 100644 Binary files a/docs/assets/screenshots/chart-combo-dark.png and b/docs/assets/screenshots/chart-combo-dark.png differ diff --git a/docs/assets/screenshots/chart-combo-light.png b/docs/assets/screenshots/chart-combo-light.png index e0152ccb..e47f8c13 100644 Binary files a/docs/assets/screenshots/chart-combo-light.png and b/docs/assets/screenshots/chart-combo-light.png differ diff --git a/docs/assets/screenshots/chart-dark.png b/docs/assets/screenshots/chart-dark.png index 82e27bd4..f1a279a7 100644 Binary files a/docs/assets/screenshots/chart-dark.png and b/docs/assets/screenshots/chart-dark.png differ diff --git a/docs/assets/screenshots/chart-display-dark.png b/docs/assets/screenshots/chart-display-dark.png index 211a15af..7adc6fa5 100644 Binary files a/docs/assets/screenshots/chart-display-dark.png and b/docs/assets/screenshots/chart-display-dark.png differ diff --git a/docs/assets/screenshots/chart-display-light.png b/docs/assets/screenshots/chart-display-light.png index c4d336b6..aa37611f 100644 Binary files a/docs/assets/screenshots/chart-display-light.png and b/docs/assets/screenshots/chart-display-light.png differ diff --git a/docs/assets/screenshots/chart-groups-dark.png b/docs/assets/screenshots/chart-groups-dark.png index 93502e48..aa2a8d6d 100644 Binary files a/docs/assets/screenshots/chart-groups-dark.png and b/docs/assets/screenshots/chart-groups-dark.png differ diff --git a/docs/assets/screenshots/chart-groups-light.png b/docs/assets/screenshots/chart-groups-light.png index 1564cfd8..caa8f865 100644 Binary files a/docs/assets/screenshots/chart-groups-light.png and b/docs/assets/screenshots/chart-groups-light.png differ diff --git a/docs/assets/screenshots/chart-light.png b/docs/assets/screenshots/chart-light.png index ed23719e..ff3807c9 100644 Binary files a/docs/assets/screenshots/chart-light.png and b/docs/assets/screenshots/chart-light.png differ diff --git a/docs/assets/screenshots/chart-lines-dark.png b/docs/assets/screenshots/chart-lines-dark.png index 8ce888bc..d0441721 100644 Binary files a/docs/assets/screenshots/chart-lines-dark.png and b/docs/assets/screenshots/chart-lines-dark.png differ diff --git a/docs/assets/screenshots/chart-lines-level-dark.png b/docs/assets/screenshots/chart-lines-level-dark.png index 0bb8d1e3..df0722d0 100644 Binary files a/docs/assets/screenshots/chart-lines-level-dark.png and b/docs/assets/screenshots/chart-lines-level-dark.png differ diff --git a/docs/assets/screenshots/chart-lines-level-light.png b/docs/assets/screenshots/chart-lines-level-light.png index c213c00b..09172fd9 100644 Binary files a/docs/assets/screenshots/chart-lines-level-light.png and b/docs/assets/screenshots/chart-lines-level-light.png differ diff --git a/docs/assets/screenshots/chart-lines-light.png b/docs/assets/screenshots/chart-lines-light.png index 6757abc6..33e09d8e 100644 Binary files a/docs/assets/screenshots/chart-lines-light.png and b/docs/assets/screenshots/chart-lines-light.png differ diff --git a/docs/assets/screenshots/chart-points-dark.png b/docs/assets/screenshots/chart-points-dark.png index 38570827..0d374862 100644 Binary files a/docs/assets/screenshots/chart-points-dark.png and b/docs/assets/screenshots/chart-points-dark.png differ diff --git a/docs/assets/screenshots/chart-points-light.png b/docs/assets/screenshots/chart-points-light.png index 408282de..a02c9e58 100644 Binary files a/docs/assets/screenshots/chart-points-light.png and b/docs/assets/screenshots/chart-points-light.png differ diff --git a/docs/assets/screenshots/chart-tooltip-dark.png b/docs/assets/screenshots/chart-tooltip-dark.png index d9d94cbd..ec554c8c 100644 Binary files a/docs/assets/screenshots/chart-tooltip-dark.png and b/docs/assets/screenshots/chart-tooltip-dark.png differ diff --git a/docs/assets/screenshots/chart-tooltip-light.png b/docs/assets/screenshots/chart-tooltip-light.png index c84a4049..ec1585d0 100644 Binary files a/docs/assets/screenshots/chart-tooltip-light.png and b/docs/assets/screenshots/chart-tooltip-light.png differ diff --git a/docs/assets/screenshots/chart-treemap-dark.png b/docs/assets/screenshots/chart-treemap-dark.png index 75bdb0d7..95a1e1ac 100644 Binary files a/docs/assets/screenshots/chart-treemap-dark.png and b/docs/assets/screenshots/chart-treemap-dark.png differ diff --git a/docs/assets/screenshots/chart-treemap-light.png b/docs/assets/screenshots/chart-treemap-light.png index f14666fc..4a559b63 100644 Binary files a/docs/assets/screenshots/chart-treemap-light.png and b/docs/assets/screenshots/chart-treemap-light.png differ diff --git a/docs/assets/screenshots/chart-zoom-dark.png b/docs/assets/screenshots/chart-zoom-dark.png index a2ba332e..16f10efc 100644 Binary files a/docs/assets/screenshots/chart-zoom-dark.png and b/docs/assets/screenshots/chart-zoom-dark.png differ diff --git a/docs/assets/screenshots/chart-zoom-light.png b/docs/assets/screenshots/chart-zoom-light.png index e41e28e4..3b2fd5ff 100644 Binary files a/docs/assets/screenshots/chart-zoom-light.png and b/docs/assets/screenshots/chart-zoom-light.png differ diff --git a/docs/assets/screenshots/column-subtotals-dark.png b/docs/assets/screenshots/column-subtotals-dark.png index 5920e896..0dc04c1c 100644 Binary files a/docs/assets/screenshots/column-subtotals-dark.png and b/docs/assets/screenshots/column-subtotals-dark.png differ diff --git a/docs/assets/screenshots/column-subtotals-light.png b/docs/assets/screenshots/column-subtotals-light.png index e97a622e..3060dbe3 100644 Binary files a/docs/assets/screenshots/column-subtotals-light.png and b/docs/assets/screenshots/column-subtotals-light.png differ diff --git a/docs/assets/screenshots/data-menu-dark.png b/docs/assets/screenshots/data-menu-dark.png index 576756d4..9586a6a8 100644 Binary files a/docs/assets/screenshots/data-menu-dark.png and b/docs/assets/screenshots/data-menu-dark.png differ diff --git a/docs/assets/screenshots/data-menu-light.png b/docs/assets/screenshots/data-menu-light.png index 99781dab..ed1a782a 100644 Binary files a/docs/assets/screenshots/data-menu-light.png and b/docs/assets/screenshots/data-menu-light.png differ diff --git a/docs/assets/screenshots/date-context-dark.png b/docs/assets/screenshots/date-context-dark.png index d8fbf905..9eff2b3a 100644 Binary files a/docs/assets/screenshots/date-context-dark.png and b/docs/assets/screenshots/date-context-dark.png differ diff --git a/docs/assets/screenshots/date-context-light.png b/docs/assets/screenshots/date-context-light.png index 68a0e26f..ea52d7aa 100644 Binary files a/docs/assets/screenshots/date-context-light.png and b/docs/assets/screenshots/date-context-light.png differ diff --git a/docs/assets/screenshots/date-years-dark.png b/docs/assets/screenshots/date-years-dark.png index 19c05a2f..ce33efab 100644 Binary files a/docs/assets/screenshots/date-years-dark.png and b/docs/assets/screenshots/date-years-dark.png differ diff --git a/docs/assets/screenshots/date-years-light.png b/docs/assets/screenshots/date-years-light.png index 17cb087e..ab9b0259 100644 Binary files a/docs/assets/screenshots/date-years-light.png and b/docs/assets/screenshots/date-years-light.png differ diff --git a/docs/assets/screenshots/donut-labels-dark.png b/docs/assets/screenshots/donut-labels-dark.png index 6ac7aae3..7b4bb6c5 100644 Binary files a/docs/assets/screenshots/donut-labels-dark.png and b/docs/assets/screenshots/donut-labels-dark.png differ diff --git a/docs/assets/screenshots/donut-labels-light.png b/docs/assets/screenshots/donut-labels-light.png index 88ef2296..c2eca83e 100644 Binary files a/docs/assets/screenshots/donut-labels-light.png and b/docs/assets/screenshots/donut-labels-light.png differ diff --git a/docs/assets/screenshots/donut-other-dark.png b/docs/assets/screenshots/donut-other-dark.png index 41efafb8..e51ddb0b 100644 Binary files a/docs/assets/screenshots/donut-other-dark.png and b/docs/assets/screenshots/donut-other-dark.png differ diff --git a/docs/assets/screenshots/donut-other-light.png b/docs/assets/screenshots/donut-other-light.png index ccbf1c97..c37da070 100644 Binary files a/docs/assets/screenshots/donut-other-light.png and b/docs/assets/screenshots/donut-other-light.png differ diff --git a/docs/assets/screenshots/donut-phone-dark.png b/docs/assets/screenshots/donut-phone-dark.png index 0cc55541..c862257a 100644 Binary files a/docs/assets/screenshots/donut-phone-dark.png and b/docs/assets/screenshots/donut-phone-dark.png differ diff --git a/docs/assets/screenshots/donut-phone-light.png b/docs/assets/screenshots/donut-phone-light.png index ccaa4b56..97d56d31 100644 Binary files a/docs/assets/screenshots/donut-phone-light.png and b/docs/assets/screenshots/donut-phone-light.png differ diff --git a/docs/assets/screenshots/drill-down-dark.png b/docs/assets/screenshots/drill-down-dark.png index 8644a640..07b23967 100644 Binary files a/docs/assets/screenshots/drill-down-dark.png and b/docs/assets/screenshots/drill-down-dark.png differ diff --git a/docs/assets/screenshots/drill-down-light.png b/docs/assets/screenshots/drill-down-light.png index 88628e7d..acf084a3 100644 Binary files a/docs/assets/screenshots/drill-down-light.png and b/docs/assets/screenshots/drill-down-light.png differ diff --git a/docs/assets/screenshots/drill-export-dark.png b/docs/assets/screenshots/drill-export-dark.png index f19a0bea..8193f3ec 100644 Binary files a/docs/assets/screenshots/drill-export-dark.png and b/docs/assets/screenshots/drill-export-dark.png differ diff --git a/docs/assets/screenshots/drill-export-light.png b/docs/assets/screenshots/drill-export-light.png index 7046be48..26ae3a46 100644 Binary files a/docs/assets/screenshots/drill-export-light.png and b/docs/assets/screenshots/drill-export-light.png differ diff --git a/docs/assets/screenshots/enlarged-dark.png b/docs/assets/screenshots/enlarged-dark.png index e1f65347..6c13bf01 100644 Binary files a/docs/assets/screenshots/enlarged-dark.png and b/docs/assets/screenshots/enlarged-dark.png differ diff --git a/docs/assets/screenshots/enlarged-light.png b/docs/assets/screenshots/enlarged-light.png index 9d80972d..e44c3b52 100644 Binary files a/docs/assets/screenshots/enlarged-light.png and b/docs/assets/screenshots/enlarged-light.png differ diff --git a/docs/assets/screenshots/explanations-dark.png b/docs/assets/screenshots/explanations-dark.png index 22c42b06..df9a7384 100644 Binary files a/docs/assets/screenshots/explanations-dark.png and b/docs/assets/screenshots/explanations-dark.png differ diff --git a/docs/assets/screenshots/explanations-light.png b/docs/assets/screenshots/explanations-light.png index 58369b6e..bcc4784f 100644 Binary files a/docs/assets/screenshots/explanations-light.png and b/docs/assets/screenshots/explanations-light.png differ diff --git a/docs/assets/screenshots/export-menu-dark.png b/docs/assets/screenshots/export-menu-dark.png index 8b63745f..c01fe776 100644 Binary files a/docs/assets/screenshots/export-menu-dark.png and b/docs/assets/screenshots/export-menu-dark.png differ diff --git a/docs/assets/screenshots/export-menu-light.png b/docs/assets/screenshots/export-menu-light.png index 9ee77d09..0d9610b3 100644 Binary files a/docs/assets/screenshots/export-menu-light.png and b/docs/assets/screenshots/export-menu-light.png differ diff --git a/docs/assets/screenshots/field-info-dark.png b/docs/assets/screenshots/field-info-dark.png index b7cd4457..38804b96 100644 Binary files a/docs/assets/screenshots/field-info-dark.png and b/docs/assets/screenshots/field-info-dark.png differ diff --git a/docs/assets/screenshots/field-info-light.png b/docs/assets/screenshots/field-info-light.png index 0bceaf7c..8a2ac36f 100644 Binary files a/docs/assets/screenshots/field-info-light.png and b/docs/assets/screenshots/field-info-light.png differ diff --git a/docs/assets/screenshots/field-menu-dark.png b/docs/assets/screenshots/field-menu-dark.png index 1191ab40..0167f933 100644 Binary files a/docs/assets/screenshots/field-menu-dark.png and b/docs/assets/screenshots/field-menu-dark.png differ diff --git a/docs/assets/screenshots/field-menu-light.png b/docs/assets/screenshots/field-menu-light.png index 1ad2cf8a..b717bd8d 100644 Binary files a/docs/assets/screenshots/field-menu-light.png and b/docs/assets/screenshots/field-menu-light.png differ diff --git a/docs/assets/screenshots/field-rail-dark.png b/docs/assets/screenshots/field-rail-dark.png index 8b67f3c4..4c81276a 100644 Binary files a/docs/assets/screenshots/field-rail-dark.png and b/docs/assets/screenshots/field-rail-dark.png differ diff --git a/docs/assets/screenshots/field-rail-light.png b/docs/assets/screenshots/field-rail-light.png index 0869b227..aa8e9d6c 100644 Binary files a/docs/assets/screenshots/field-rail-light.png and b/docs/assets/screenshots/field-rail-light.png differ diff --git a/docs/assets/screenshots/filter-blanks-dark.png b/docs/assets/screenshots/filter-blanks-dark.png index 40845527..e8270170 100644 Binary files a/docs/assets/screenshots/filter-blanks-dark.png and b/docs/assets/screenshots/filter-blanks-dark.png differ diff --git a/docs/assets/screenshots/filter-blanks-light.png b/docs/assets/screenshots/filter-blanks-light.png index 2f026e90..cb35ced0 100644 Binary files a/docs/assets/screenshots/filter-blanks-light.png and b/docs/assets/screenshots/filter-blanks-light.png differ diff --git a/docs/assets/screenshots/filter-cyclic-dark.png b/docs/assets/screenshots/filter-cyclic-dark.png index 40606169..c18823dd 100644 Binary files a/docs/assets/screenshots/filter-cyclic-dark.png and b/docs/assets/screenshots/filter-cyclic-dark.png differ diff --git a/docs/assets/screenshots/filter-cyclic-light.png b/docs/assets/screenshots/filter-cyclic-light.png index 17e9a4f1..c3cb2e1c 100644 Binary files a/docs/assets/screenshots/filter-cyclic-light.png and b/docs/assets/screenshots/filter-cyclic-light.png differ diff --git a/docs/assets/screenshots/filter-dark.png b/docs/assets/screenshots/filter-dark.png index 986e82d6..c992eed4 100644 Binary files a/docs/assets/screenshots/filter-dark.png and b/docs/assets/screenshots/filter-dark.png differ diff --git a/docs/assets/screenshots/filter-dates-dark.png b/docs/assets/screenshots/filter-dates-dark.png index 7c025a0e..a16dc19d 100644 Binary files a/docs/assets/screenshots/filter-dates-dark.png and b/docs/assets/screenshots/filter-dates-dark.png differ diff --git a/docs/assets/screenshots/filter-dates-light.png b/docs/assets/screenshots/filter-dates-light.png index edb09249..358d3b3e 100644 Binary files a/docs/assets/screenshots/filter-dates-light.png and b/docs/assets/screenshots/filter-dates-light.png differ diff --git a/docs/assets/screenshots/filter-light.png b/docs/assets/screenshots/filter-light.png index 935cc59d..6d69cd38 100644 Binary files a/docs/assets/screenshots/filter-light.png and b/docs/assets/screenshots/filter-light.png differ diff --git a/docs/assets/screenshots/filter-more-dark.png b/docs/assets/screenshots/filter-more-dark.png index 16d13a99..8e56c29f 100644 Binary files a/docs/assets/screenshots/filter-more-dark.png and b/docs/assets/screenshots/filter-more-dark.png differ diff --git a/docs/assets/screenshots/filter-more-light.png b/docs/assets/screenshots/filter-more-light.png index f27c09bc..8415ce53 100644 Binary files a/docs/assets/screenshots/filter-more-light.png and b/docs/assets/screenshots/filter-more-light.png differ diff --git a/docs/assets/screenshots/filter-rules-dark.png b/docs/assets/screenshots/filter-rules-dark.png index 68477ac5..a99de107 100644 Binary files a/docs/assets/screenshots/filter-rules-dark.png and b/docs/assets/screenshots/filter-rules-dark.png differ diff --git a/docs/assets/screenshots/filter-rules-light.png b/docs/assets/screenshots/filter-rules-light.png index f2171cd8..6a87cebc 100644 Binary files a/docs/assets/screenshots/filter-rules-light.png and b/docs/assets/screenshots/filter-rules-light.png differ diff --git a/docs/assets/screenshots/filter-state-dark.png b/docs/assets/screenshots/filter-state-dark.png index dfdb2bad..d0362f6f 100644 Binary files a/docs/assets/screenshots/filter-state-dark.png and b/docs/assets/screenshots/filter-state-dark.png differ diff --git a/docs/assets/screenshots/filter-state-light.png b/docs/assets/screenshots/filter-state-light.png index d7d27092..60a1b3b2 100644 Binary files a/docs/assets/screenshots/filter-state-light.png and b/docs/assets/screenshots/filter-state-light.png differ diff --git a/docs/assets/screenshots/filter-zone-dark.png b/docs/assets/screenshots/filter-zone-dark.png index 44d5b42c..4c2ce801 100644 Binary files a/docs/assets/screenshots/filter-zone-dark.png and b/docs/assets/screenshots/filter-zone-dark.png differ diff --git a/docs/assets/screenshots/filter-zone-light.png b/docs/assets/screenshots/filter-zone-light.png index 149c075a..1ad44790 100644 Binary files a/docs/assets/screenshots/filter-zone-light.png and b/docs/assets/screenshots/filter-zone-light.png differ diff --git a/docs/assets/screenshots/german-dark.png b/docs/assets/screenshots/german-dark.png index 68f86c05..b95e2613 100644 Binary files a/docs/assets/screenshots/german-dark.png and b/docs/assets/screenshots/german-dark.png differ diff --git a/docs/assets/screenshots/german-light.png b/docs/assets/screenshots/german-light.png index 3333a42d..7d078ab8 100644 Binary files a/docs/assets/screenshots/german-light.png and b/docs/assets/screenshots/german-light.png differ diff --git a/docs/assets/screenshots/group-level-dark.png b/docs/assets/screenshots/group-level-dark.png index 55bde61d..7bb2a37f 100644 Binary files a/docs/assets/screenshots/group-level-dark.png and b/docs/assets/screenshots/group-level-dark.png differ diff --git a/docs/assets/screenshots/group-level-light.png b/docs/assets/screenshots/group-level-light.png index e1a870ab..1656e3f4 100644 Binary files a/docs/assets/screenshots/group-level-light.png and b/docs/assets/screenshots/group-level-light.png differ diff --git a/docs/assets/screenshots/import-drop-dark.png b/docs/assets/screenshots/import-drop-dark.png index b8ff74b2..d9419ef5 100644 Binary files a/docs/assets/screenshots/import-drop-dark.png and b/docs/assets/screenshots/import-drop-dark.png differ diff --git a/docs/assets/screenshots/import-drop-light.png b/docs/assets/screenshots/import-drop-light.png index 2b8c57de..4533f25e 100644 Binary files a/docs/assets/screenshots/import-drop-light.png and b/docs/assets/screenshots/import-drop-light.png differ diff --git a/docs/assets/screenshots/import-empty-dark.png b/docs/assets/screenshots/import-empty-dark.png index e997c513..285bbeec 100644 Binary files a/docs/assets/screenshots/import-empty-dark.png and b/docs/assets/screenshots/import-empty-dark.png differ diff --git a/docs/assets/screenshots/import-empty-light.png b/docs/assets/screenshots/import-empty-light.png index 071a9238..84d2bcaf 100644 Binary files a/docs/assets/screenshots/import-empty-light.png and b/docs/assets/screenshots/import-empty-light.png differ diff --git a/docs/assets/screenshots/import-loaded-dark.png b/docs/assets/screenshots/import-loaded-dark.png index 90d8a22b..e684e138 100644 Binary files a/docs/assets/screenshots/import-loaded-dark.png and b/docs/assets/screenshots/import-loaded-dark.png differ diff --git a/docs/assets/screenshots/import-loaded-light.png b/docs/assets/screenshots/import-loaded-light.png index 9dae14d8..3e8a0ec9 100644 Binary files a/docs/assets/screenshots/import-loaded-light.png and b/docs/assets/screenshots/import-loaded-light.png differ diff --git a/docs/assets/screenshots/import-phone-dark.png b/docs/assets/screenshots/import-phone-dark.png index 05f3460a..74b4cb5c 100644 Binary files a/docs/assets/screenshots/import-phone-dark.png and b/docs/assets/screenshots/import-phone-dark.png differ diff --git a/docs/assets/screenshots/import-phone-light.png b/docs/assets/screenshots/import-phone-light.png index 0bc8f27b..c5bdc2aa 100644 Binary files a/docs/assets/screenshots/import-phone-light.png and b/docs/assets/screenshots/import-phone-light.png differ diff --git a/docs/assets/screenshots/import-preview-dark.png b/docs/assets/screenshots/import-preview-dark.png index 9a920730..b0d1dca1 100644 Binary files a/docs/assets/screenshots/import-preview-dark.png and b/docs/assets/screenshots/import-preview-dark.png differ diff --git a/docs/assets/screenshots/import-preview-light.png b/docs/assets/screenshots/import-preview-light.png index 60ea2c4f..f21e11c5 100644 Binary files a/docs/assets/screenshots/import-preview-light.png and b/docs/assets/screenshots/import-preview-light.png differ diff --git a/docs/assets/screenshots/learn-earthquakes-dark.png b/docs/assets/screenshots/learn-earthquakes-dark.png index 4045256a..fe90c19f 100644 Binary files a/docs/assets/screenshots/learn-earthquakes-dark.png and b/docs/assets/screenshots/learn-earthquakes-dark.png differ diff --git a/docs/assets/screenshots/learn-earthquakes-light.png b/docs/assets/screenshots/learn-earthquakes-light.png index e94caa84..b0e1dea3 100644 Binary files a/docs/assets/screenshots/learn-earthquakes-light.png and b/docs/assets/screenshots/learn-earthquakes-light.png differ diff --git a/docs/assets/screenshots/learn-endoflife-dark.png b/docs/assets/screenshots/learn-endoflife-dark.png index e6c27fc0..a3d8d439 100644 Binary files a/docs/assets/screenshots/learn-endoflife-dark.png and b/docs/assets/screenshots/learn-endoflife-dark.png differ diff --git a/docs/assets/screenshots/learn-endoflife-light.png b/docs/assets/screenshots/learn-endoflife-light.png index 8f8a678e..13193c44 100644 Binary files a/docs/assets/screenshots/learn-endoflife-light.png and b/docs/assets/screenshots/learn-endoflife-light.png differ diff --git a/docs/assets/screenshots/learn-nobel-dark.png b/docs/assets/screenshots/learn-nobel-dark.png index 355b0aa7..f853aec0 100644 Binary files a/docs/assets/screenshots/learn-nobel-dark.png and b/docs/assets/screenshots/learn-nobel-dark.png differ diff --git a/docs/assets/screenshots/learn-nobel-light.png b/docs/assets/screenshots/learn-nobel-light.png index 0e6ef936..16cc0a17 100644 Binary files a/docs/assets/screenshots/learn-nobel-light.png and b/docs/assets/screenshots/learn-nobel-light.png differ diff --git a/docs/assets/screenshots/load-check-dark.png b/docs/assets/screenshots/load-check-dark.png index 543946fa..86f1f504 100644 Binary files a/docs/assets/screenshots/load-check-dark.png and b/docs/assets/screenshots/load-check-dark.png differ diff --git a/docs/assets/screenshots/load-check-light.png b/docs/assets/screenshots/load-check-light.png index 71b5b4f7..fd23f11e 100644 Binary files a/docs/assets/screenshots/load-check-light.png and b/docs/assets/screenshots/load-check-light.png differ diff --git a/docs/assets/screenshots/more-menu-dark.png b/docs/assets/screenshots/more-menu-dark.png index 1293cb3b..6a2a4d75 100644 Binary files a/docs/assets/screenshots/more-menu-dark.png and b/docs/assets/screenshots/more-menu-dark.png differ diff --git a/docs/assets/screenshots/more-menu-light.png b/docs/assets/screenshots/more-menu-light.png index 52e0bd5c..0ec10180 100644 Binary files a/docs/assets/screenshots/more-menu-light.png and b/docs/assets/screenshots/more-menu-light.png differ diff --git a/docs/assets/screenshots/phone-dark.png b/docs/assets/screenshots/phone-dark.png index 6303a5f9..66538fbb 100644 Binary files a/docs/assets/screenshots/phone-dark.png and b/docs/assets/screenshots/phone-dark.png differ diff --git a/docs/assets/screenshots/phone-light.png b/docs/assets/screenshots/phone-light.png index 527d7533..2a80fca9 100644 Binary files a/docs/assets/screenshots/phone-light.png and b/docs/assets/screenshots/phone-light.png differ diff --git a/docs/assets/screenshots/phone-value-menu-dark.png b/docs/assets/screenshots/phone-value-menu-dark.png index abfb0aba..871a467d 100644 Binary files a/docs/assets/screenshots/phone-value-menu-dark.png and b/docs/assets/screenshots/phone-value-menu-dark.png differ diff --git a/docs/assets/screenshots/phone-value-menu-light.png b/docs/assets/screenshots/phone-value-menu-light.png index d6194ed6..042c1ad1 100644 Binary files a/docs/assets/screenshots/phone-value-menu-light.png and b/docs/assets/screenshots/phone-value-menu-light.png differ diff --git a/docs/assets/screenshots/quick-chart-dark.png b/docs/assets/screenshots/quick-chart-dark.png index 7bdc8f41..35e83c29 100644 Binary files a/docs/assets/screenshots/quick-chart-dark.png and b/docs/assets/screenshots/quick-chart-dark.png differ diff --git a/docs/assets/screenshots/quick-chart-light.png b/docs/assets/screenshots/quick-chart-light.png index f6a12d46..29b08c31 100644 Binary files a/docs/assets/screenshots/quick-chart-light.png and b/docs/assets/screenshots/quick-chart-light.png differ diff --git a/docs/assets/screenshots/quick-columns-dark.png b/docs/assets/screenshots/quick-columns-dark.png index 290003fd..dd8b812e 100644 Binary files a/docs/assets/screenshots/quick-columns-dark.png and b/docs/assets/screenshots/quick-columns-dark.png differ diff --git a/docs/assets/screenshots/quick-columns-light.png b/docs/assets/screenshots/quick-columns-light.png index a65d5a9b..a3f56360 100644 Binary files a/docs/assets/screenshots/quick-columns-light.png and b/docs/assets/screenshots/quick-columns-light.png differ diff --git a/docs/assets/screenshots/quick-empty-dark.png b/docs/assets/screenshots/quick-empty-dark.png index ffd9edeb..4747702d 100644 Binary files a/docs/assets/screenshots/quick-empty-dark.png and b/docs/assets/screenshots/quick-empty-dark.png differ diff --git a/docs/assets/screenshots/quick-empty-light.png b/docs/assets/screenshots/quick-empty-light.png index 454ac2ae..130f966f 100644 Binary files a/docs/assets/screenshots/quick-empty-light.png and b/docs/assets/screenshots/quick-empty-light.png differ diff --git a/docs/assets/screenshots/quick-filter-dark.png b/docs/assets/screenshots/quick-filter-dark.png index 58693783..3df20317 100644 Binary files a/docs/assets/screenshots/quick-filter-dark.png and b/docs/assets/screenshots/quick-filter-dark.png differ diff --git a/docs/assets/screenshots/quick-filter-light.png b/docs/assets/screenshots/quick-filter-light.png index 2c095b1e..4decd505 100644 Binary files a/docs/assets/screenshots/quick-filter-light.png and b/docs/assets/screenshots/quick-filter-light.png differ diff --git a/docs/assets/screenshots/quick-rows-dark.png b/docs/assets/screenshots/quick-rows-dark.png index fa130320..44c26908 100644 Binary files a/docs/assets/screenshots/quick-rows-dark.png and b/docs/assets/screenshots/quick-rows-dark.png differ diff --git a/docs/assets/screenshots/quick-rows-light.png b/docs/assets/screenshots/quick-rows-light.png index d24fd226..a36b04cd 100644 Binary files a/docs/assets/screenshots/quick-rows-light.png and b/docs/assets/screenshots/quick-rows-light.png differ diff --git a/docs/assets/screenshots/quick-values-dark.png b/docs/assets/screenshots/quick-values-dark.png index 38a81349..f6446d67 100644 Binary files a/docs/assets/screenshots/quick-values-dark.png and b/docs/assets/screenshots/quick-values-dark.png differ diff --git a/docs/assets/screenshots/quick-values-light.png b/docs/assets/screenshots/quick-values-light.png index 42c1fbad..a5bf12f7 100644 Binary files a/docs/assets/screenshots/quick-values-light.png and b/docs/assets/screenshots/quick-values-light.png differ diff --git a/docs/assets/screenshots/report-dark.png b/docs/assets/screenshots/report-dark.png index ebfbd525..df157131 100644 Binary files a/docs/assets/screenshots/report-dark.png and b/docs/assets/screenshots/report-dark.png differ diff --git a/docs/assets/screenshots/report-light.png b/docs/assets/screenshots/report-light.png index d2c8f831..3d340ff2 100644 Binary files a/docs/assets/screenshots/report-light.png and b/docs/assets/screenshots/report-light.png differ diff --git a/docs/assets/screenshots/start-over-dark.png b/docs/assets/screenshots/start-over-dark.png index 65b03201..5d9e0d8d 100644 Binary files a/docs/assets/screenshots/start-over-dark.png and b/docs/assets/screenshots/start-over-dark.png differ diff --git a/docs/assets/screenshots/start-over-light.png b/docs/assets/screenshots/start-over-light.png index bc10321e..37195ca3 100644 Binary files a/docs/assets/screenshots/start-over-light.png and b/docs/assets/screenshots/start-over-light.png differ diff --git a/docs/assets/screenshots/tips-dark.png b/docs/assets/screenshots/tips-dark.png index ea65153c..26d425be 100644 Binary files a/docs/assets/screenshots/tips-dark.png and b/docs/assets/screenshots/tips-dark.png differ diff --git a/docs/assets/screenshots/tips-light.png b/docs/assets/screenshots/tips-light.png index ae537c21..856a3e1b 100644 Binary files a/docs/assets/screenshots/tips-light.png and b/docs/assets/screenshots/tips-light.png differ diff --git a/docs/assets/screenshots/top-items-dark.png b/docs/assets/screenshots/top-items-dark.png index c0b22bce..738fb9df 100644 Binary files a/docs/assets/screenshots/top-items-dark.png and b/docs/assets/screenshots/top-items-dark.png differ diff --git a/docs/assets/screenshots/top-items-light.png b/docs/assets/screenshots/top-items-light.png index 6964692c..6e1c0603 100644 Binary files a/docs/assets/screenshots/top-items-light.png and b/docs/assets/screenshots/top-items-light.png differ diff --git a/docs/assets/screenshots/unused-parts-dark.png b/docs/assets/screenshots/unused-parts-dark.png index 527591f8..cfaf8d2d 100644 Binary files a/docs/assets/screenshots/unused-parts-dark.png and b/docs/assets/screenshots/unused-parts-dark.png differ diff --git a/docs/assets/screenshots/unused-parts-light.png b/docs/assets/screenshots/unused-parts-light.png index 2091e876..bdba5c22 100644 Binary files a/docs/assets/screenshots/unused-parts-light.png and b/docs/assets/screenshots/unused-parts-light.png differ diff --git a/docs/assets/screenshots/value-filter-dark.png b/docs/assets/screenshots/value-filter-dark.png index 388e54f8..6a239f2a 100644 Binary files a/docs/assets/screenshots/value-filter-dark.png and b/docs/assets/screenshots/value-filter-dark.png differ diff --git a/docs/assets/screenshots/value-filter-light.png b/docs/assets/screenshots/value-filter-light.png index bfd35b29..eb315d6f 100644 Binary files a/docs/assets/screenshots/value-filter-light.png and b/docs/assets/screenshots/value-filter-light.png differ diff --git a/docs/assets/screenshots/value-menu-dark.png b/docs/assets/screenshots/value-menu-dark.png index d985b503..4bfcfd67 100644 Binary files a/docs/assets/screenshots/value-menu-dark.png and b/docs/assets/screenshots/value-menu-dark.png differ diff --git a/docs/assets/screenshots/value-menu-light.png b/docs/assets/screenshots/value-menu-light.png index b4ba6d85..4736e538 100644 Binary files a/docs/assets/screenshots/value-menu-light.png and b/docs/assets/screenshots/value-menu-light.png differ diff --git a/docs/assets/screenshots/view-name-dark.png b/docs/assets/screenshots/view-name-dark.png index 9e5a647d..958c2a70 100644 Binary files a/docs/assets/screenshots/view-name-dark.png and b/docs/assets/screenshots/view-name-dark.png differ diff --git a/docs/assets/screenshots/view-name-light.png b/docs/assets/screenshots/view-name-light.png index 9c040e20..5f7f4837 100644 Binary files a/docs/assets/screenshots/view-name-light.png and b/docs/assets/screenshots/view-name-light.png differ diff --git a/docs/assets/screenshots/views-menu-dark.png b/docs/assets/screenshots/views-menu-dark.png index 1c1fde28..cd455a0b 100644 Binary files a/docs/assets/screenshots/views-menu-dark.png and b/docs/assets/screenshots/views-menu-dark.png differ diff --git a/docs/assets/screenshots/views-menu-light.png b/docs/assets/screenshots/views-menu-light.png index fc6dfc7a..9c99c03f 100644 Binary files a/docs/assets/screenshots/views-menu-light.png and b/docs/assets/screenshots/views-menu-light.png differ diff --git a/docs/assets/screenshots/views-this-view-dark.png b/docs/assets/screenshots/views-this-view-dark.png index c2c4e137..f098ab5c 100644 Binary files a/docs/assets/screenshots/views-this-view-dark.png and b/docs/assets/screenshots/views-this-view-dark.png differ diff --git a/docs/assets/screenshots/views-this-view-light.png b/docs/assets/screenshots/views-this-view-light.png index 75b95dc5..8180d409 100644 Binary files a/docs/assets/screenshots/views-this-view-light.png and b/docs/assets/screenshots/views-this-view-light.png differ diff --git a/docs/getting-started/upgrading.md b/docs/getting-started/upgrading.md index 63979f23..5f00c58d 100644 --- a/docs/getting-started/upgrading.md +++ b/docs/getting-started/upgrading.md @@ -119,6 +119,7 @@ The next release, on `main` now. The table lists the changes that need an action | --- | --- | --- | | **Breaking:** a key file that starts with a UTF-8 byte order mark is refused | a key's `{ "file" }` (`output.downloads.key`, `audit.key`, a backend's or the upload store's secret) starts with one, as Windows PowerShell 5.1's `-Encoding UTF8` writes it | save the file as UTF-8 without the mark. `check-config` names the file. Download links made with the old key stop working, and audit hashes change | | A backend's sign-in and `output.upload`'s headers read `{ "env" }` secrets from the `env` the host passes | a host passes its own `env` to `createContext` or `serve()` without those variables | add the variables to that `env`. The start warns when a backend's sign-in cannot read its secret | +| The report's corners and type icons: `--pk-radius` is 8 px (was 10 px), chips take `--pk-radius-sm`, and `--pk-type-string`, `--pk-type-number`, `--pk-type-date` and `--pk-type-boolean` default to `--pk-muted` (were one colour each) | a host sets `--pk-radius` or relies on coloured type icons, such as a theme that maps its own colours to these tokens | set `--pk-radius` or the `--pk-type-*` tokens yourself. See [theming](../reference/theming.md#tokens) | ### From 0.9 to 0.10 { #from-0-9 } diff --git a/docs/reference/theming.md b/docs/reference/theming.md index b8e0e21e..7bac3d69 100644 --- a/docs/reference/theming.md +++ b/docs/reference/theming.md @@ -93,7 +93,7 @@ size through the element. | `--pk-shadow-sm`
`--pk-scrim`
`--pk-scrim-light` | Chip shadow; behind sheets and the drawer; behind the drill-down | see `styles.css` | see `styles.css` | | `--pk-total`
`--pk-total-strong` | Subtotal and grand total rows and columns | `#eef1f5`
`#e9edf3` | `#21252d`
`#252a33` | | `--pk-danger`
`--pk-danger-soft`
`--pk-warn`
`--pk-focus` | Remove and errors; the card of a filter that shows nothing; a warning in a line of text (the days of a range without data); the focus ring | `#b42318`
`#fdecea`
`#8a5a00`
`#2b5fd9` | `#ff8b80`
`#3a1f1d`
`#f3c56b`
`#84a3ff` | -| `--pk-radius`
`--pk-radius-sm` | Corners of panels and popovers; of buttons, chips and fields | `10px`
`7px` | as light | +| `--pk-radius`
`--pk-radius-sm` | Corners of panels, zones and popovers; of buttons, chips, fields and a field's name in the table's header | `8px`
`7px` | as light | | `--pk-radius-xs`
`--pk-radius-mark`
`--pk-radius-icon` | Smaller corners, in step with `--pk-radius-sm` (set that one and these follow): links, a list's options, a column's sort button and keys; small parts inside a chip, a cell or a list (a field's grip, a badge, a filter's value, the fold button of a group in the table); a field's type icon | `calc(var(--pk-radius-sm) * 4 / 7)` (4 px)
`calc(var(--pk-radius-sm) * 5 / 7)` (5 px)
`calc(var(--pk-radius-sm) * 6 / 7)` (6 px) | as light | | `--pk-radius-card`
`--pk-radius-chart` | The chart's tooltip and the HTML report's chart card; the chart's bars and pie slices (a heatmap's cells three quarters of it) | `8px`
`var(--pk-radius-xs)` (4 px) | as light | | `--pk-font-mono` | The code font of the text field a view's JSON is pasted into | `ui-monospace, SFMono-Regular, Menlo, Consolas, monospace` | as light | @@ -119,7 +119,11 @@ size through the element. | `--pk-primary-bg`
`--pk-primary-text`
`--pk-primary-hover-bg` | The main action of a dialog (Apply, Save, Load): its fill and frame; its text; its fill on hover | `var(--pk-accent)`
`var(--pk-accent-text)`
`color-mix(in srgb, var(--pk-accent) 88%, var(--pk-text))` | as light | | `--pk-tooltip-name-w` | Widest series name in the chart's tooltip; a longer one ends in "…" | `12em` | as light | | `--pk-duration`
`--pk-ease` | Animations; `0ms` with `prefers-reduced-motion: reduce` | `180ms`
`cubic-bezier(0.2, 0.8, 0.2, 1)` | as light | -| `--pk-type-string`
`--pk-type-number`
`--pk-type-date`
`--pk-type-boolean` | Field type icons | `#6250d6`
`#1a7f5a`
`#b5560b`
`#a3367a` | `#a99dff`
`#5fd3a3`
`#f2a65a`
`#f08cc6` | +| `--pk-type-string`
`--pk-type-number`
`--pk-type-date`
`--pk-type-boolean` | Field type icons in the field list and on chips. Neutral, so that colour marks the zones only; set one to colour a type | `var(--pk-muted)` each | as light | +| `--pk-zone-rows`
`--pk-zone-columns`
`--pk-zone-values`
`--pk-zone-filters` | Each zone's colour: its title's icon, its mark in the field list, the icon before a field's name in the table's header, and the tint of its chips and of that name. For icons only, never for text: each keeps 4.6:1 on `--pk-surface-2` (the values colour also on the Grand Total header, `--pk-total-strong`) and 3:1 on its own fill | `#1d5fcc`
`#a85a00`
`#0b785c`
`var(--pk-muted)` | `#8db4ff`
`#f2b559`
`#5fd6ac`
`var(--pk-muted)` | +| `--pk-zone-tint`
`--pk-zone-tint-base` | The fill of a zone's chips, of its marks in the field list and of a field's name in the table's header: an opaque mix of this share of the zone's colour into this base. A filter's chip has no fill. Where the browser has no `color-mix()`, the fill is `--pk-surface-3`; in forced colours it is a frame | `16%`
`var(--pk-surface)` | as light | +| `--pk-control-icon`
`--pk-sort-arrow` | A chip's grip, menu arrow and ×; the sort arrow behind the name of the sorted header in the table and on its chip (drawn bold). The controls, a filter's chip and the type icons keep 3:1 on every zone's fill with the default `--pk-muted`: a host that lightens `--pk-muted` or these tokens must check that | `var(--pk-muted)`
`var(--pk-text)` | as light | +| `--pk-field-hover` | A field's background in the field list on hover | `var(--pk-surface)` | as light | | `--pk-chart-1` ... `--pk-chart-8` | Chart series colours, in this order; read by ECharts | `#2a78d6`
`#eb6834`
`#1baf7a`
`#eda100`
`#e87ba4`
`#008300`
`#6250d6`
`#e34948` | `#3987e5`
`#d95926`
`#199e70`
`#c98500`
`#d55181`
`#008300`
`#9085e9`
`#e66767` | | `--pk-chart-axis` | The chart's axis line, apart from the table's lines. Not set, it is `--pk-border` | not set | not set | | `--pk-chart-reference` | The chart's reference lines of no series: a target, the lines of a stack's total. A series' own lines take its colour | `var(--pk-muted)` | `var(--pk-muted)` | diff --git a/docs/use/fields.md b/docs/use/fields.md index b1c11e04..7856b6be 100644 --- a/docs/use/fields.md +++ b/docs/use/fields.md @@ -17,8 +17,8 @@ A field in a zone is a **chip**. Its menu changes how the report shows the field | Part | Where | What it does | | --- | --- | --- | -| **Fields** | left | Every column of the data, with a search and an icon for its type: text, number, date or yes/no. A mark next to a field shows which zone it is in. When the application describes a field, an **i** next to it says what the field means. A long field name takes two lines and breaks between words only. A word too long for its line ends in "…", and pointing at the name shows it whole. | -| **The zones** | below the toolbar | **Rows**, **Columns**, **Values** and **Filters**, each a shelf: its title, its **i** and **+ Add** on the left, its chips beside them. On a wide report the shelves form a grid of two equal columns: Filters and Columns on top, Rows and Values below. On a narrow one they stand one below the other. A shelf keeps its width when you add a field, and its chips wrap inside it. The **i** next to a zone's title says what the zone does, with an example. More, Help, **Show explanations** switches these off and on. The zones sit under the heading **Fields in the report**, which folds them. **Swap rows and columns** is at the right end of that heading. | +| **Fields** | left | Every column of the data, with a search and an icon for its type: text, number, date or yes/no. A mark in the zone's colour next to a field shows which zone it is in. When the application describes a field, an **i** next to it says what the field means. A long field name takes two lines and breaks between words only. A word too long for its line ends in "…", and pointing at the name shows it whole. | +| **The zones** | below the toolbar | **Rows**, **Columns**, **Values** and **Filters**, each a shelf: its title, its **i** and **+ Add** on the left, its chips beside them. Each zone has a colour and an icon, by default blue for Rows, orange for Columns, green for Values. Their chips take a light tint of it; a filter's chip has none. On a wide report the shelves form a grid of two equal columns: Filters and Columns on top, Rows and Values below. On a narrow one they stand one below the other. A shelf keeps its width when you add a field, and its chips wrap inside it. The **i** next to a zone's title says what the zone does, with an example. More, Help, **Show explanations** switches these off and on. The zones sit under the heading **Fields in the report**, which folds them. **Swap rows and columns** is at the right end of that heading. | | **The toolbar** | top | Undo, Redo, Start over (Reset, New), the name of the view you loaded, Views, Export and **More**. **More** holds **Help** first, then what does not fit. See [small screens](layout.md#small-screens). | | **The result** | below | The tabs **Table**, **Chart** and, on a wide report, **Both** on top, with the settings of the view shown, **Enlarge** and **Full screen** beside them. Tips stand above the tabs, a status line below the result. | @@ -225,8 +225,11 @@ The menu of a value is on [Values and formats](values.md#the-menu-of-a-value). - The header and the row labels stay in place while you scroll. - Fields in Rows without a value show their labels only. They have no empty column, and no total rows. The arrows still collapse the groups. + - Each field's name in the header carries its zone's icon and tint, the same as its chip: Rows + above the row labels, Columns left of their items, Values under the items. - You can drag field names and value names from the header into a zone. - - With one value, its name stands once over all of its columns. + - With one value, its name stands once over all of its columns. With two or more, each value's + name repeats under each column with its icon and without the tint. - The table is as wide as its columns and scrolls sideways when it is wider than the report. - Long row labels wrap between words when the table is wider than the report, so on a phone numbers stay in view next to them. diff --git a/docs/use/filters.md b/docs/use/filters.md index 84e23d7d..fad2f4d3 100644 --- a/docs/use/filters.md +++ b/docs/use/filters.md @@ -195,8 +195,10 @@ Type numbers the way the report's own language writes them: "1.000,5" in a Germa | A field's name, such as "Region" | Z to A | back to A to Z, then Z to A again | The **Grand Total** column's name sorts by the whole row. A value's name does nothing while Rows is -empty. An arrow before the name shows the sort; its tooltip says what the next click does. The keyboard -reaches every name with Tab, then Enter. +empty. An arrow behind the name of the sorted header shows the order, the same arrow as on the +field's chip. A custom order has no arrow, on the header or the chip. On any other header the arrow +shows on hover and on focus, for the order a click gives; the tooltip says what the next click does. +The keyboard reaches every name with Tab, then Enter. ### In the field's menu diff --git a/docs/use/keyboard.md b/docs/use/keyboard.md index b6bece00..e44c5b40 100644 --- a/docs/use/keyboard.md +++ b/docs/use/keyboard.md @@ -45,8 +45,10 @@ and what changed. In the report itself, **More**, **Help**, **Keyboard shortcuts changed". A level's title names the field, such as "Month › Group". A level with fields is a group with that heading. A level of choices is a menu. The Filter level says how many items it keeps as it changes. - - The header whose sort you chose says its order: "sorted descending". After a click on a header, a - screen reader reads out the new order: "Region sorted: Z to A". + - The header whose sort you chose says its order and what the next click does: "sorted Largest + Sum of Revenue first. Sort by Sum of Revenue: smallest first". A field's name in the header + heads its labels or items, and the empty corner names the fields in Rows and Columns. After a + click on a header, a screen reader reads out the new order: "Region sorted: Z to A". - The chart has a text alternative: type, values, counts, highest and lowest value. - A screen reader reads out status messages, such as "Undone: Region removed" or "View “Sales” saved". See [status messages](behaviour.md#status-messages). diff --git a/packages/pivotkit-element/CHANGELOG.md b/packages/pivotkit-element/CHANGELOG.md index 3fda0719..8788750c 100644 --- a/packages/pivotkit-element/CHANGELOG.md +++ b/packages/pivotkit-element/CHANGELOG.md @@ -14,6 +14,8 @@ All notable changes to `pivotkit-element` are documented in this file. The forma ### Changed +- The zones' colours and the field names in the table's header (see pivotkit-react) add 0.7 KiB to + the first load: 179.7 KiB gzip on an official Node 24 build, within its budget of 182.5 KiB ([#920](https://github.com/eizedev/pivotkit/issues/920)). - The first load is 3.3 KiB smaller: 179.0 KiB gzip on an official Node 24 build, in 13 files as before (was 182.3 KiB). Its budget stays at 182.5 KiB. The code moved loads on demand, and the budgets of the chart, export and report groups rise with it (260.7, 13.7 and 26.8 KiB): diff --git a/packages/pivotkit-react/CHANGELOG.md b/packages/pivotkit-react/CHANGELOG.md index 83d58817..aee18ab4 100644 --- a/packages/pivotkit-react/CHANGELOG.md +++ b/packages/pivotkit-react/CHANGELOG.md @@ -6,12 +6,18 @@ All notable changes to `pivotkit-react` are documented in this file. The format ## [Unreleased] -### Changed - -- The README says that a minor release of 0.x can break things, with links to Versioning and Upgrading. - ### Added +- Each zone has a colour: `--pk-zone-rows`, `--pk-zone-columns`, `--pk-zone-values` and + `--pk-zone-filters` (the values colour is `#0b785c`, so a value's name keeps 4.6:1 on the Grand + Total column's header too). Its chips, its marks in the field list and a field's name in the + table's header take a fill mixed from it (`--pk-zone-tint`, 16 %, into `--pk-zone-tint-base`). New + tokens for a chip's controls (`--pk-control-icon`), the sort arrow (`--pk-sort-arrow`) and a + field's hover in the field list (`--pk-field-hover`) + ([#920](https://github.com/eizedev/pivotkit/issues/920)). +- Each field's name in the table's header carries its zone's icon and fill; with two or more values + each value's name carries the icon alone. Header cells name the cells they head (`scope`), and the + empty corner names the fields in Rows and Columns for a screen reader ([#920](https://github.com/eizedev/pivotkit/issues/920)). - The package exports `TIP_IDS` and `NOTICE_IDS`, the ids of the tips and of the notices. A host that checks a `tips` list no longer reads them from an internal chunk ([#720](https://github.com/eizedev/pivotkit/issues/720)). @@ -24,6 +30,16 @@ All notable changes to `pivotkit-react` are documented in this file. The format ### Changed +- The sort arrow stands behind a header's name, at rest only on the sorted header, in the text + colour and bold, the same arrow as on the sorted chip. A custom order draws no arrow on either. + The sorted header's description says its order and what the next click does + ([#920](https://github.com/eizedev/pivotkit/issues/920)). +- Chips of rows, columns and values have the zone's fill and no coloured frame; a filter's chip + stays neutral. The field type icons are neutral: `--pk-type-*` default to `--pk-muted` and stay + overridable. They are drawn at 16px, so their letters stand as tall as 11px text. Chips take + `--pk-radius-sm`, and `--pk-radius` is 8px (was 10px) + ([#920](https://github.com/eizedev/pivotkit/issues/920)). +- The README says that a minor release of 0.x can break things, with links to Versioning and Upgrading. - The chart's ECharts instance, its events and each draw are in `chart-draw.js`, which loads with ECharts. A report that never shows a chart no longer loads that code ([#772](https://github.com/eizedev/pivotkit/issues/772)). diff --git a/packages/pivotkit-react/src/fields.jsx b/packages/pivotkit-react/src/fields.jsx index c24d84b9..9e1526a8 100644 --- a/packages/pivotkit-react/src/fields.jsx +++ b/packages/pivotkit-react/src/fields.jsx @@ -51,7 +51,7 @@ function FieldItem({ field, labels, zones, onAdd, onNote, onFilter, name, source - + {typeLabel} @@ -515,16 +547,12 @@ export function PivotTable({ grid, view, labels, onToggle: toggleGroup, onCell, const className = `pk-th pk-${cell.kind}${totalClass(cell.total)}${subStart(c)}${sticky ? " pk-sticky" : ""}`; const target = onSort ? headerSortTarget(view, cell, typeOf) : null; const sorting = target ? sortButton(cell, target) : null; - const content = ( - - {cell.toggle ? : null} - {sorting ? sorting.content : {cell.text}} - - ); - const props = { className, style: stickyStyle(c, top), colSpan: cell.colSpan, rowSpan: cell.rowSpan, scope: cell.kind === "colHeader" ? "col" : undefined }; + // a field's name: its zone's icon, and its fill (header-cells.js) + const named = headerField(view, cell, r === grid.headerRows - 1); + const content = ; + const props = { className, style: stickyStyle(c, top), colSpan: cell.colSpan, rowSpan: cell.rowSpan, scope: scopeOf(cell, named) }; if (cell.kind === "corner" && !cell.field && !cell.text) { - // an empty corner names nothing: a plain cell, not a header without a name - return ; + return ; } if (cell.kind === "corner" && cell.field) { const zone = view.rows.includes(cell.field) ? "rows" : "cols"; diff --git a/packages/pivotkit-react/src/zones.jsx b/packages/pivotkit-react/src/zones.jsx index e6725618..86e85983 100644 --- a/packages/pivotkit-react/src/zones.jsx +++ b/packages/pivotkit-react/src/zones.jsx @@ -131,9 +131,11 @@ function Badges({ state, view, labels, locale }) { ); } - if (state.sort) { + // the glyph of the table's sorted header: one glyph for one order. A custom order (either way + // round) shows no arrow, as its header shows none; its name says it ("sorted Custom order") + if (state.sort && state.sort.by !== "custom") { const desc = state.sort.order === "desc"; - parts.push(); + parts.push(); } return parts.length ? <>{parts} : null; } @@ -149,12 +151,12 @@ function Chip({ id, zone, index, count, field, text, title, typeName, view, type const name = words ? `${full}, ${words}` : title; const remove = () => onRemove(zone, index, text); return ( -
  • +
  • - + {src.label ?? src.field} diff --git a/packages/pivotkit-react/test/contrast.test.js b/packages/pivotkit-react/test/contrast.test.js index ab7812d3..062f3a41 100644 --- a/packages/pivotkit-react/test/contrast.test.js +++ b/packages/pivotkit-react/test/contrast.test.js @@ -6,15 +6,23 @@ import { readFileSync } from "node:fs"; const css = readFileSync(new URL("../src/styles.css", import.meta.url), "utf8"); +/** The colour tokens of a block: a #rrggbb, or another token's name for a var() of it. */ function tokens(selector) { const start = css.indexOf(`${selector} {`); assert.ok(start !== -1, `no block ${selector}`); const block = css.slice(start, css.indexOf("}", start)); - return Object.fromEntries([...block.matchAll(/(--pk-[\w-]+):\s*(#[0-9a-fA-F]{6})\b/g)].map((m) => [m[1], m[2]])); + return Object.fromEntries([...block.matchAll(/(--pk-[\w-]+):\s*(?:(#[0-9a-fA-F]{6})\b|var\((--pk-[\w-]+)\);)/g)].map((m) => [m[1], m[2] ?? m[3]])); } -const light = tokens(":where(.pk-root)"); -const dark = { ...light, ...tokens(':where(.pk-root[data-pk-theme="dark"])') }; +/** Each token's colour in a theme: a var() is read in that theme, as the browser resolves it. */ +function resolved(theme) { + const colour = (name, seen = 0) => (theme[name]?.startsWith("--") && seen < 10 ? colour(theme[name], seen + 1) : theme[name]); + return Object.fromEntries(Object.keys(theme).map((name) => [name, colour(name)])); +} + +const lightTokens = tokens(":where(.pk-root)"); +const light = resolved(lightTokens); +const dark = resolved({ ...lightTokens, ...tokens(':where(.pk-root[data-pk-theme="dark"])') }); function luminance(hex) { const [r, g, b] = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255).map((c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4)); @@ -42,7 +50,41 @@ const UI = [["--pk-focus", "--pk-surface"], ["--pk-focus", "--pk-surface-2"], [" // the rule between a menu's groups: More's groups have no titles, the rule is all that tells them apart (#128) ["--pk-rule", "--pk-surface-raised"], ["--pk-rule", "--pk-surface"], ["--pk-rule", "--pk-surface-2"]]; +const ZONES = ["--pk-zone-rows", "--pk-zone-columns", "--pk-zone-values", "--pk-zone-filters"]; +const rgbOf = (hex) => [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16)); +const hexOf = (c) => `#${c.map((v) => Math.round(v).toString(16).padStart(2, "0")).join("")}`; +/** A zone's fill as styles.css mixes it (.pk-zone-fill): --pk-zone-tint of its colour in --pk-zone-tint-base. */ +function fillOf(theme, zone) { + const tint = Number(/--pk-zone-tint:\s*(\d+)%/.exec(css)?.[1]) / 100; + assert.ok(tint > 0, "no --pk-zone-tint"); + const [colour, base] = [rgbOf(theme[zone]), rgbOf(theme["--pk-zone-tint-base"])]; + return hexOf(colour.map((v, i) => v * tint + base[i] * (1 - tint))); +} + for (const [name, theme] of [["light", light], ["dark", dark]]) { + // the zones' colours are for icons only (#920): 4.6:1 on the table's header, 3:1 on their own fill; + // a field's name on the fill is text, the chip's controls and the sort arrow interface colours + test(`${name} theme: the zones' colours on the header and their fills; text, controls and the sort arrow on each fill`, () => { + for (const zone of ZONES) { + const fill = fillOf(theme, zone); + const pairs = [ + [zone, theme["--pk-surface-2"], 4.6], + [zone, fill, 3], + ["--pk-text", fill, 4.5], + ["--pk-control-icon", fill, 3], + ["--pk-sort-arrow", fill, 3], + // the focus ring around a filled chip or header name + ["--pk-focus", fill, 3] + ]; + // a value's name repeats over the Grand Total column, whose header is darker + if (zone === "--pk-zone-values") pairs.push([zone, theme["--pk-total-strong"], 4.6]); + for (const [fg, bg, least] of pairs) { + const ratio = contrast(theme[fg], bg); + assert.ok(ratio >= least, `${fg} on ${bg === fill ? `the fill of ${zone}` : bg}: ${ratio.toFixed(2)}`); + } + } + }); + test(`${name} theme: text 4.5:1 and interface colours 3:1`, () => { for (const [fg, bg] of TEXT) { const ratio = contrast(theme[fg], theme[bg]); diff --git a/packages/pivotkit-react/test/header-cells.test.js b/packages/pivotkit-react/test/header-cells.test.js new file mode 100644 index 00000000..159f6034 --- /dev/null +++ b/packages/pivotkit-react/test/header-cells.test.js @@ -0,0 +1,72 @@ +// What the table's header cells name (#920): a field's name gets its zone, its fill (a value name +// repeated over the columns its icon alone) and the scope of the cells it heads; the empty corner +// names the fields on each axis. Read from the grid pivotkit-core builds, as the table draws it. +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { computePivot, encode, normalize, toGrid } from "pivotkit-core"; +import { LABELS } from "../src/labels.js"; +import "../src/deferred.js"; +import { cornerLabel, headerField, scopeOf } from "../src/header-cells.js"; + +const data = encode([ + { Team: "Desk", Category: "Access", Priority: "P1", Channel: "Chat", Hours: 2 }, + { Team: "Net", Category: "Email", Priority: "P2", Channel: "Mail", Hours: 3 } +]); +const count = { field: "Hours", agg: "count" }; +const sum = { field: "Hours", agg: "sum" }; + +/** Each header cell that names a field, as "text: zone fill scope", row by row. */ +function named(spec) { + const view = normalize(spec, data).view; + const grid = toGrid(computePivot(data, view)); + const out = []; + grid.rows.slice(0, grid.headerRows).forEach((row, r) => { + for (const cell of row) { + const field = cell ? headerField(view, cell, r === grid.headerRows - 1) : null; + if (field) out.push(`${cell.text}: ${field.zone}${field.fill ? " filled" : ""} ${field.scope}`); + } + }); + return out; +} + +test("one field on each axis and one value: every field name filled, in its zone's scope", () => { + assert.deepEqual(named({ rows: ["Team"], cols: ["Priority"], values: [count] }), ["Priority: cols filled row", "Team: rows filled col", "Count of Hours: values filled col"]); +}); + +test("two fields on each axis: a column field's name heads its row of items, a row field's name its column of labels", () => { + assert.deepEqual(named({ rows: ["Team", "Category"], cols: ["Priority", "Channel"], values: [count] }), [ + "Priority: cols filled row", + "Channel: cols filled row", + "Team: rows filled col", + "Category: rows filled col", + "Count of Hours: values filled col" + ]); +}); + +test("two values: their names stay the lowest column level, each with its icon and without the fill", () => { + const cells = named({ rows: ["Team"], cols: ["Priority"], values: [count, sum] }); + assert.deepEqual(cells.slice(0, 2), ["Priority: cols filled row", "Team: rows filled col"]); + // the names repeat under each priority and the grand total + assert.deepEqual([...new Set(cells.slice(2))], ["Count of Hours: values col", "Sum of Hours: values col"]); + assert.equal(cells.length, 2 + 2 * 3); +}); + +test("an item, a total and the empty corner name no field", () => { + const view = normalize({ rows: ["Team", "Category"], cols: ["Priority"], values: [count] }, data).view; + assert.equal(headerField(view, { kind: "colHeader", text: "P1", colPath: ["P1"] }, false), null); + assert.equal(headerField(view, { kind: "corner", text: "" }, false), null); + // a value's name above the last row is an item's header, not the value's + assert.equal(headerField(view, { kind: "colHeader", text: "Count of Hours", valueIndex: 0 }, false), null); + // an item heads its column; the empty corner heads nothing + assert.equal(scopeOf({ kind: "colHeader" }, null), "col"); + assert.equal(scopeOf({ kind: "corner" }, null), undefined); + assert.equal(scopeOf({ kind: "corner" }, { scope: "row" }), "row"); +}); + +test("the empty corner names the fields on each axis, in the report's language", () => { + const view = { rows: ["Team", "Category"], cols: ["Priority", "Channel"] }; + assert.equal(cornerLabel(view, LABELS.en), "Rows: Team, Category; Columns: Priority, Channel"); + assert.equal(cornerLabel(view, LABELS.de), "Zeilen: Team, Category; Spalten: Priority, Channel"); + assert.equal(cornerLabel({ rows: [], cols: ["Priority"] }, LABELS.en), "Columns: Priority"); + assert.equal(cornerLabel({ rows: [], cols: [] }, LABELS.en), ""); +}); diff --git a/scripts/growth-baseline.json b/scripts/growth-baseline.json index 0531ae86..3e367dc0 100644 --- a/scripts/growth-baseline.json +++ b/scripts/growth-baseline.json @@ -48,7 +48,7 @@ "packages/pivotkit-react/src/popover.jsx Function 'MenuButton'": [27], "packages/pivotkit-react/src/popover.jsx Function 'Popover'": [26], "packages/pivotkit-react/src/quick-choices.jsx Function 'QuickChoices'": [29], - "packages/pivotkit-react/src/table.jsx Arrow function": [32], + "packages/pivotkit-react/src/table.jsx Arrow function": [29], "packages/pivotkit-react/src/templates.js Function 'templateEntries'": [27], "packages/pivotkit-react/src/toolbar-panels.jsx Function 'ViewsPanel'": [30], "packages/pivotkit-react/src/toolbar.jsx Function 'Toolbar'": [27], @@ -132,7 +132,7 @@ "packages/pivotkit-react/src/menu-topics.js Function 'chartTopics'": [128], "packages/pivotkit-react/src/popover.jsx Function 'Popover'": [205], "packages/pivotkit-react/src/quick-choices.jsx Function 'QuickChoices'": [349], - "packages/pivotkit-react/src/table.jsx Function 'PivotTable'": [355], + "packages/pivotkit-react/src/table.jsx Function 'PivotTable'": [352], "packages/pivotkit-react/src/toolbar-panels.jsx Function 'ViewsPanel'": [139], "packages/pivotkit-react/src/toolbar.jsx Function 'Toolbar'": [152], "packages/pivotkit-react/src/zones.jsx Function 'Zones'": [143], diff --git a/tests/browser/sort-column.spec.js b/tests/browser/sort-column.spec.js index 36c1ad4a..d4fc5108 100644 --- a/tests/browser/sort-column.spec.js +++ b/tests/browser/sort-column.spec.js @@ -1,6 +1,6 @@ // Sorting by one column from the table (#70): a month's header sorts the cities by that month, the -// column field's name in the corner sorts the months, every sortable header shows a faint arrow at -// rest, and the arrows widen nothing. +// column field's name in the corner sorts the months, a header's arrow shows at rest only once its +// sort is chosen (on the others on hover and focus, #920), and the arrows widen nothing. import { encodeViewLink } from "pivotkit-core/link"; import { expect, test } from "./fixtures.js"; @@ -34,17 +34,20 @@ test("a column's header sorts the rows by that column: largest first, smallest f expect(await rowNames(page)).toEqual(before); }); -test("the column field's name sorts the columns Z to A and back; every sortable header shows a faint arrow", async ({ page }) => { +test("the column field's name sorts the columns Z to A and back; its arrow shows at rest once it sorts", async ({ page }) => { await page.goto(`?data=sales&lang=en&empty#pivot-playground=${encodeViewLink(VIEW)}`); await expect(page.locator(".pk-table")).toBeVisible(); const columns = () => page.locator(".pk-table thead tr").first().locator("th.pk-colHeader").allTextContents(); const first = await columns(); const corner = page.locator(".pk-table thead th.pk-corner", { hasText: "Channel" }).locator(".pk-th-sort"); - // every sortable header shows its arrow at rest, faint + // no sort chosen: no arrow at rest (#920) const arrows = await page.locator(".pk-table thead .pk-th-arrow").evaluateAll((els) => els.map((e) => Number(getComputedStyle(e).opacity))); expect(arrows.length).toBeGreaterThan(3); - expect(arrows.every((o) => o > 0 && o < 1)).toBe(true); + expect(arrows.every((o) => o === 0)).toBe(true); await corner.click(); + // the sorted header's arrow stays at rest, away from the pointer + await page.mouse.move(0, 0); + await expect(corner.locator(".pk-th-arrow")).toHaveCSS("opacity", "1"); expect(await columns()).toEqual([...first].reverse().filter((c) => c !== "Grand Total").concat(first.includes("Grand Total") ? ["Grand Total"] : [])); await corner.click(); expect(await columns()).toEqual(first); diff --git a/tests/browser/table-header.spec.js b/tests/browser/table-header.spec.js new file mode 100644 index 00000000..1c032978 --- /dev/null +++ b/tests/browser/table-header.spec.js @@ -0,0 +1,308 @@ +// The table's header (#920): each field's name carries its zone's icon and fill (a value name repeated +// over the columns its icon alone), in the same fill as its chip and its mark in the field list; the +// values stay the lowest column level; the header cells keep their scope, the empty corner names the +// fields on each axis; the sort arrow stands behind the name, at rest only on the sorted header, in the +// glyph of the sorted chip. The zones' colours keep 4.6:1 on the header and 3:1 on their fills, a +// chip's controls 3:1 on its fill: measured as the browser draws them, light and dark, wide and narrow, +// in English and German. +import { encodeViewLink } from "pivotkit-core/link"; +import { expect, test } from "./fixtures.js"; +import { installContrast } from "./contrast.js"; + +const count = { field: "Ticket", agg: "count" }; +const lead = { field: "Lead hours", agg: "average", format: "duration:h" }; +const sort = [{ field: "Team", by: "value", order: "desc" }]; +const LAYOUTS = [ + { name: "one field on each axis, one value", view: { rows: ["Team"], cols: ["Priority"], values: [count], sort } }, + { name: "two fields on each axis, one value", view: { rows: ["Team", "Category"], cols: ["Priority", "Channel"], values: [count], sort } }, + { name: "one field on each axis, two values", view: { rows: ["Team"], cols: ["Priority"], values: [count, lead], sort } }, + { name: "two fields on each axis, two values", view: { rows: ["Team", "Category"], cols: ["Priority", "Channel"], values: [count, lead], sort } } +]; +const VALUE_NAMES = { en: ["Count of Ticket", "Average of Lead hours"], de: ["Anzahl von Ticket", "Durchschnitt von Lead hours"] }; +const CORNER = { + en: "Rows: Team, Category; Columns: Priority, Channel", + de: "Zeilen: Team, Category; Spalten: Priority, Channel" +}; + +/** The playground with a view, in a theme and a language. */ +async function open(page, view, { theme = "light", lang = "en", data = "tickets" } = {}) { + await page.goto(`?data=${data}&empty&lang=${lang}&theme=${theme}#pivot-playground=${encodeViewLink(view)}`); + await expect(page.locator('[data-testid="pivot-table"] thead th').first()).toBeVisible(); +} + +/** Each field's name in the header, row by row: its text, zone, fill, scope and whether it has its zone's icon. */ +const fieldNames = (page) => + page.getByTestId("pivot-table").locator("thead tr").evaluateAll((rows) => + rows.flatMap((tr, r) => + [...tr.querySelectorAll(".pk-th-field")].map((el) => { + const zone = [...el.classList].find((c) => c.startsWith("pk-th-zone-"))?.slice("pk-th-zone-".length); + const fill = el.classList.contains("pk-zone-fill") ? " filled" : ""; + const icon = el.querySelector(":scope > .pk-th-zone") ? "" : " NO ICON"; + return `${r}: ${el.querySelector(".pk-th-text").textContent} ${zone}${fill} ${el.closest("th").getAttribute("scope")}${icon}`; + }) + ) + ); + +/** What the header should show for a layout: row field names in the last row, column field names one row each. */ +function expected(view, lang, headerRows) { + const last = headerRows - 1; + const names = VALUE_NAMES[lang]; + const cols = view.cols.map((f, r) => `${r}: ${f} cols filled row`); + const rows = view.rows.map((f) => `${last}: ${f} rows filled col`); + return { cols, rows, values: view.values.map((_, i) => `${last}: ${names[i]} values${view.values.length < 2 ? " filled" : ""} col`) }; +} + +/** + * The least contrast of what the header and the chips draw in the zones' colours, as the browser + * resolves them: a zone's icon on the header's background and on its fill, a field's name on its + * fill, a chip's controls (grip, menu arrow, x) on the chip's fill. + */ +const contrasts = (page) => + page.evaluate(() => { + const { parse, ratio, behind } = /** @type {any} */ (window).__pkContrast; + const least = (pairs) => Math.min(...pairs.map(([fg, bg]) => ratio(parse(getComputedStyle(fg).color), behind(bg)))); + const header = [...document.querySelectorAll(".pk-table thead .pk-th-field")]; + const filled = header.filter((el) => el.classList.contains("pk-zone-fill")); + const chips = [...document.querySelectorAll(".pk-chip.pk-zone-fill")]; + const controls = chips.flatMap((chip) => [...chip.querySelectorAll(".pk-handle, .pk-caret, .pk-chip-x")].map((c) => [c, chip])); + const onGrand = (el) => el.closest("th").classList.contains("pk-grand"); + return { + iconOnHeader: least(header.filter((el) => !onGrand(el)).map((el) => [el.querySelector(".pk-th-zone"), el.closest("th")])), + iconOnGrand: header.some(onGrand) ? least(header.filter(onGrand).map((el) => [el.querySelector(".pk-th-zone"), el.closest("th")])) : Infinity, + iconOnFill: least(filled.map((el) => [el.querySelector(".pk-th-zone"), el])), + nameOnFill: least(filled.map((el) => [el.querySelector(".pk-th-text"), el])), + controlsOnFill: controls.length ? least(controls) : Infinity + }; + }); + +test.describe("the table's header names its fields by zone (#920)", () => { + for (const layout of LAYOUTS) { + test(`${layout.name}: icons, fills, scopes and contrast, light and dark, 1280 and 390 px, English and German`, async ({ page }) => { + const least = { iconOnHeader: Infinity, iconOnGrand: Infinity, iconOnFill: Infinity, nameOnFill: Infinity, controlsOnFill: Infinity }; + for (const theme of ["light", "dark"]) { + for (const width of [1280, 390]) { + for (const lang of ["en", "de"]) { + const where = `${theme}, ${width} px, ${lang}`; + await page.setViewportSize({ width, height: 900 }); + await open(page, layout.view, { theme, lang }); + const table = page.getByTestId("pivot-table"); + const headerRows = await table.locator("thead tr").count(); + const names = await fieldNames(page); + const want = expected(layout.view, lang, headerRows); + expect(names.filter((n) => n.includes(" cols ")), where).toEqual(want.cols); + expect(names.filter((n) => n.includes(" rows ")), where).toEqual(want.rows); + // the values stay the lowest column level: each value's name, once per column with two values + const values = names.filter((n) => n.includes(" values ")); + expect([...new Set(values)], where).toEqual(want.values); + // the empty corner names the fields on each axis; a corner with a field's name is that header + const blank = table.locator("thead td.pk-blank"); + if (layout.view.rows.length > 1) { + await expect(blank.locator(".pk-sr"), where).toHaveText(CORNER[lang]); + } + // the field's name is text in the text's colour, never in the zone's + const colours = await table.locator("thead .pk-th-field .pk-th-text").evaluateAll((els) => [...new Set(els.map((e) => getComputedStyle(e).color))]); + const text = await page.locator(".pk-root").evaluate((el) => getComputedStyle(el).color); + expect(colours, where).toEqual([text]); + await installContrast(page); + const measured = await contrasts(page); + for (const key of Object.keys(least)) { + least[key] = Math.min(least[key], measured[key]); + } + } + } + } + // on the header, and on the Grand Total column's darker header as well + expect(least.iconOnHeader).toBeGreaterThanOrEqual(4.6); + expect(least.iconOnGrand).toBeGreaterThanOrEqual(4.6); + expect(least.iconOnFill).toBeGreaterThanOrEqual(3); + expect(least.nameOnFill).toBeGreaterThanOrEqual(4.5); + expect(least.controlsOnFill).toBeGreaterThanOrEqual(3); + test.info().annotations.push({ type: "contrast", description: JSON.stringify(Object.fromEntries(Object.entries(least).map(([k, v]) => [k, Number(v.toFixed(2))]))) }); + }); + } + + test("a screen reader hears the header cells as headers: field names without their icon, a data cell under its row and column items", async ({ page }) => { + await open(page, LAYOUTS[1].view); + const table = page.getByTestId("pivot-table"); + // a column field's name heads its row of items, a row field's name its column of labels + await expect(table.getByRole("rowheader", { name: "Priority", exact: true })).toHaveAttribute("scope", "row"); + await expect(table.getByRole("rowheader", { name: "Channel", exact: true })).toHaveAttribute("scope", "row"); + await expect(table.getByRole("columnheader", { name: "Team", exact: true })).toHaveAttribute("scope", "col"); + await expect(table.getByRole("columnheader", { name: "Category", exact: true })).toHaveAttribute("scope", "col"); + await expect(table.getByRole("columnheader", { name: "Count of Ticket", exact: true })).toHaveAttribute("scope", "col"); + await expect(table.getByRole("columnheader", { name: "Chat", exact: true }).first()).toHaveAttribute("scope", "col"); + // the empty corner is no header: it names the axes in words of its own + await expect(table.locator("thead td.pk-blank")).toHaveCount(1); + await expect(table.locator("thead th").filter({ hasText: /^$/ })).toHaveCount(0); + // the first value cell of the first row: the headers over its column and beside its row, as a + // screen reader takes them from the table (th with scope col above it, th of its row) + const heard = await table.locator('tbody tr[data-r="0"] td').first().evaluate((td) => { + const box = td.getBoundingClientRect(); + const middle = box.left + box.width / 2; + const tbl = td.closest("table"); + const columns = [...tbl.querySelectorAll('thead th[scope="col"]')].filter((th) => { + const b = th.getBoundingClientRect(); + return b.left <= middle && middle <= b.right; + }); + const rows = [...td.closest("tr").querySelectorAll('th[scope="row"]')]; + return { columns: columns.map((th) => th.textContent.trim()), rows: rows.map((th) => th.textContent.trim()) }; + }); + expect(heard.rows).toEqual(["Service Desk", "Access"]); + expect(heard.columns).toContain("Count of Ticket"); + expect(heard.columns).toEqual(expect.arrayContaining(["P1 Critical", "Chat", "Count of Ticket"])); + }); + + test("the sort arrow: behind the name, on the sorted header at rest, in the sorted chip's glyph; others on hover and focus", async ({ page }) => { + await open(page, LAYOUTS[0].view); + const table = page.getByTestId("pivot-table"); + const sorted = table.locator("thead .pk-th-sort.pk-sorted"); + await expect(sorted).toHaveCount(1); + await expect(sorted).toHaveText("Count of Ticket"); + // the order in words is the button's description, not its name: the name heads every cell below + await expect(sorted).toHaveAccessibleName("Count of Ticket"); + // and, as the tooltip says, what the next click does + await expect(sorted).toHaveAccessibleDescription("sorted Largest Count of Ticket first. Sort by Count of Ticket: smallest first"); + await expect(sorted).toHaveAttribute("title", "Sort by Count of Ticket: smallest first"); + // a reader that skips aria-description still hears the order from the header cell itself + await expect(table.locator("thead th", { has: page.locator(".pk-th-sort.pk-sorted") })).toHaveAttribute("aria-sort", "descending"); + const arrow = sorted.locator(".pk-th-arrow"); + await expect(arrow).toHaveCSS("opacity", "1"); + // behind the name + const [name, mark] = await Promise.all([sorted.locator(".pk-th-text").boundingBox(), arrow.boundingBox()]); + expect(mark.x).toBeGreaterThanOrEqual(name.x + name.width - 1); + // one glyph for one order: the chip of Team, sorted by the value, draws the same arrow in the same colour + const glyph = page.locator('[data-zone="rows"] .pk-chip .pk-sort-glyph'); + expect(await glyph.locator("path").getAttribute("d")).toBe(await arrow.locator("path").getAttribute("d")); + const look = (loc) => loc.evaluate((el) => [getComputedStyle(el).color, getComputedStyle(el).strokeWidth]); + expect(await look(glyph)).toEqual(await look(arrow)); + // any other header: no arrow at rest, the order a click gives on hover and on focus + const item = table.getByRole("columnheader", { name: "P1 Critical", exact: true }).locator(".pk-th-sort"); + const itemArrow = item.locator(".pk-th-arrow"); + await expect(itemArrow).toHaveCSS("opacity", "0"); + await item.hover(); + await expect(itemArrow).toHaveCSS("opacity", "1"); + await page.mouse.move(0, 0); + await expect(itemArrow).toHaveCSS("opacity", "0"); + await item.focus(); + await expect(itemArrow).toHaveCSS("opacity", "1"); + }); + + test("one glyph for one state: the chip and the table's header agree for no sort, A to Z, Z to A, by a value and a custom order", async ({ page }) => { + const cases = [ + ["no sort", [], null], + ["A to Z", [{ field: "Team", by: "label", order: "asc" }], "Team"], + ["Z to A", [{ field: "Team", by: "label", order: "desc" }], "Team"], + ["by a value", [{ field: "Team", by: "value", order: "desc" }], "Count of Ticket"], + // a custom order shows no arrow on either; its name says it + ["custom", [{ field: "Team", by: "custom", items: ["Server", "Network"] }], null] + ]; + const table = page.getByTestId("pivot-table"); + const glyph = page.locator('[data-zone="rows"] .pk-chip .pk-sort-glyph'); + const sorted = table.locator("thead .pk-th-sort.pk-sorted"); + for (const [name, sort, header] of cases) { + await open(page, { rows: ["Team"], cols: ["Priority"], values: [count], sort }); + if (header === null) { + await expect(sorted, name).toHaveCount(0); + await expect(glyph, name).toHaveCount(0); + continue; + } + await expect(sorted, name).toHaveText(header); + const arrow = sorted.locator(".pk-th-arrow"); + await expect(arrow, name).toHaveCSS("opacity", "1"); + await expect(glyph, name).toHaveCount(1); + expect(await glyph.locator("path").getAttribute("d"), name).toBe(await arrow.locator("path").getAttribute("d")); + } + // the custom order still says so to a screen reader, on the chip and on the header cell + await expect(page.getByTestId("chip-menu-Team")).toHaveAccessibleName(/sorted Custom order/); + await expect(table.locator("thead th", { has: page.locator(".pk-th-sort") }).filter({ hasText: "Team" })).toHaveAttribute("aria-sort", "other"); + }); + + test("a zone's fill is one colour in the field area, the field list and the table; a filter's chip and the type icons stay neutral", async ({ page }) => { + const view = { ...LAYOUTS[0].view, values: [count, lead], filters: [{ field: "Status", type: "in", items: ["Open"], blanks: "exclude" }] }; + for (const theme of ["light", "dark"]) { + await open(page, { ...view, values: [count] }, { theme }); + const bg = (selector) => page.locator(selector).first().evaluate((el) => getComputedStyle(el).backgroundColor); + for (const [zone, chip] of [["rows", "rows"], ["cols", "cols"], ["values", "values"]]) { + const fill = await bg(`.pk-chip-${chip}`); + expect(await bg(`.pk-badge-${zone}`), `${theme} ${zone}`).toBe(fill); + expect(await bg(`.pk-table thead .pk-th-zone-${zone}.pk-zone-fill`), `${theme} ${zone}`).toBe(fill); + expect(fill, `${theme} ${zone}`).not.toBe(await bg(".pk-root")); + } + await open(page, view, { theme }); + expect(await bg(".pk-chip-filters"), theme).toBe(await bg(".pk-root")); + // the type icons are neutral: the muted colour of the hints + const muted = await page.locator(".pk-root").first().evaluate((root) => { + const probe = root.appendChild(document.createElement("span")); + probe.style.color = "var(--pk-muted)"; + const color = getComputedStyle(probe).color; + probe.remove(); + return color; + }); + const types = await page.locator(".pk-field .pk-type, .pk-chip .pk-type").evaluateAll((els) => [...new Set(els.map((e) => getComputedStyle(e).color))]); + expect(types, theme).toEqual([muted]); + } + }); + + test("a type icon's letters stand as tall as 11 px text, in the field list and on chips, wide and narrow", async ({ page }) => { + await page.emulateMedia({ reducedMotion: "reduce" }); + for (const width of [1280, 390]) { + await page.setViewportSize({ width, height: 900 }); + await open(page, LAYOUTS[0].view); + if (await page.locator(".pk-zone").first().isHidden()) { + await page.getByTestId("zone-section").locator(".pk-section-fold").click(); + } + if (width < 640) { + await page.getByRole("button", { name: "Fields", exact: true }).first().click(); + } + await expect(page.locator(".pk-field .pk-type-string").first()).toBeVisible(); + const sizes = await page.evaluate(() => { + // the cap height of 11 px text in the report's font + const ctx = document.createElement("canvas").getContext("2d"); + ctx.font = `11px ${getComputedStyle(document.querySelector(".pk-root")).fontFamily}`; + const cap = ctx.measureText("H").actualBoundingBoxAscent; + // the "A" of the text type's icon spans 12 of its 24 units (icons.jsx) + const letters = [...document.querySelectorAll(":is(.pk-field, .pk-chip) .pk-type-string svg")] + .filter((svg) => svg.getClientRects().length) + .map((svg) => (svg.getBoundingClientRect().height * 12) / 24); + return { cap, letters }; + }); + expect(sizes.letters.length, `${width} px`).toBeGreaterThan(1); + expect(Math.min(...sizes.letters), `${width} px`).toBeGreaterThanOrEqual(sizes.cap); + } + }); + + test("a host's zone colours, fill share and type colours take effect", async ({ page }) => { + await open(page, LAYOUTS[0].view); + await page.addStyleTag({ content: ".pk-root { --pk-zone-rows: #6b2fa0; --pk-zone-tint: 50%; --pk-zone-tint-base: #ffffff; --pk-type-string: #b00020; }" }); + await expect(page.locator(".pk-table thead .pk-th-zone-rows .pk-th-zone")).toHaveCSS("color", "rgb(107, 47, 160)"); + // half of #6b2fa0 in white + const fill = await page.locator(".pk-chip-rows").evaluate((el) => getComputedStyle(el).backgroundColor); + expect(fill).toMatch(/^(rgb\(181, 151, 208\)|color\(srgb 0\.7\d* 0\.59\d* 0\.81\d*\))$/); + await expect(page.locator('.pk-field[data-field="Team"] .pk-type')).toHaveCSS("color", "rgb(176, 0, 32)"); + }); + + test("forced colours: a field's fill becomes a frame", async ({ page, browserName }) => { + test.skip(browserName !== "chromium", "Playwright emulates forced colours in Chromium only"); + await page.emulateMedia({ forcedColors: "active" }); + await open(page, LAYOUTS[0].view); + await expect(page.locator(".pk-table thead .pk-th-field.pk-zone-fill").first()).toHaveCSS("border-top-style", "solid"); + await expect(page.locator(".pk-badge.pk-zone-fill").first()).toHaveCSS("border-top-style", "solid"); + }); + + test("reflow: at 640 px (1280 px at 200 %) the zones stand in one column and the page does not scroll sideways; at 390 px neither", async ({ page }) => { + for (const width of [640, 390]) { + await page.setViewportSize({ width, height: 900 }); + await open(page, LAYOUTS[3].view); + expect(await page.evaluate(() => document.documentElement.scrollWidth - innerWidth), `${width} px`).toBeLessThanOrEqual(0); + } + await page.setViewportSize({ width: 640, height: 900 }); + await open(page, LAYOUTS[3].view); + const zones = page.locator(".pk-zone"); + if (await zones.first().isHidden()) { + await page.getByTestId("zone-section").locator(".pk-section-fold").click(); + } + await expect(zones.first()).toBeVisible(); + const lefts = await zones.evaluateAll((els) => [...new Set(els.map((e) => Math.round(e.getBoundingClientRect().left)))]); + expect(lefts).toHaveLength(1); + }); +});