report-studio 1.2.2 → 1.3.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 (46) hide show
  1. package/README.md +254 -3
  2. package/dist/designer-Dj330bWd.js +4690 -0
  3. package/dist/designer.js +1 -1
  4. package/dist/index.js +2 -2
  5. package/dist/react-designer.js +1 -1
  6. package/dist/react.js +1 -1
  7. package/dist/viewer-BewnkhfP.js +4028 -0
  8. package/package.json +2 -2
  9. package/src/designer/blank.js +0 -1
  10. package/src/designer/canvas.js +172 -54
  11. package/src/designer/designer.js +313 -12
  12. package/src/designer/dialog.js +609 -5
  13. package/src/designer/fields.js +128 -11
  14. package/src/designer/geometry.js +77 -4
  15. package/src/designer/grouping.js +556 -0
  16. package/src/designer/icons.js +9 -0
  17. package/src/designer/menu.js +50 -6
  18. package/src/designer/panel.js +478 -38
  19. package/src/designer/rulers.js +14 -6
  20. package/src/designer/sample-data.js +112 -31
  21. package/src/designer/select.js +3 -2
  22. package/src/designer/structure.js +126 -12
  23. package/src/designer/styles.css +661 -27
  24. package/src/designer/tokens.js +38 -11
  25. package/src/engine/calculate.js +487 -0
  26. package/src/engine/csv.js +17 -9
  27. package/src/engine/format.js +483 -0
  28. package/src/engine/group.js +350 -70
  29. package/src/engine/highlight.js +224 -0
  30. package/src/engine/index.js +8 -1
  31. package/src/engine/measure.js +53 -26
  32. package/src/engine/paginate.js +189 -92
  33. package/src/engine/resolve.js +117 -10
  34. package/src/engine/rows.js +71 -8
  35. package/src/engine/search.js +12 -4
  36. package/src/engine/tables.js +309 -11
  37. package/src/engine/validate.js +265 -8
  38. package/src/engine/xlsx-style.js +50 -4
  39. package/src/engine/xlsx.js +91 -21
  40. package/src/index.js +18 -0
  41. package/src/render/items.js +61 -10
  42. package/src/render/report.css +0 -5
  43. package/types/index.d.ts +96 -8
  44. package/types/layout.d.ts +156 -2
  45. package/dist/designer-DQlfKnTr.js +0 -3416
  46. package/dist/viewer-BSPNCNRU.js +0 -2912
@@ -19,7 +19,8 @@
19
19
  --dz-bar-height: 56px;
20
20
  /* wide enough for "reportHeader", the longest band name */
21
21
  --dz-gutter: 96px;
22
- --dz-panel: 268px;
22
+ /* room for a label column and a control column side by side, unwrapped */
23
+ --dz-panel: 304px;
23
24
  --dz-foot-height: 44px;
24
25
  /* how far the floating tools sit off the bottom edge, as the pager does */
25
26
  --dz-foot-offset: 20px;
@@ -558,7 +559,7 @@
558
559
  flex: none;
559
560
  width: var(--dz-panel);
560
561
  overflow-y: auto;
561
- padding: 16px;
562
+ padding: 16px 20px 32px;
562
563
 
563
564
  background: var(--surface);
564
565
  border-left: 1px solid var(--border);
@@ -606,7 +607,7 @@
606
607
  }
607
608
 
608
609
  .dz-section {
609
- padding: 12px 0;
610
+ padding: 18px 0;
610
611
  border-bottom: 1px solid var(--border);
611
612
  }
612
613
 
@@ -615,7 +616,7 @@
615
616
  }
616
617
 
617
618
  .dz-section h3 {
618
- margin-bottom: 10px;
619
+ margin-bottom: 14px;
619
620
  font-size: 10px;
620
621
  font-weight: 600;
621
622
  letter-spacing: .06em;
@@ -626,13 +627,21 @@
626
627
  /**
627
628
  * Label left, control right, on one line. Two lines per field would make the
628
629
  * rail twice as tall as the page it describes.
630
+ *
631
+ * The label column is a fixed width rather than a share, so every control in
632
+ * the rail starts at the same x and the eye can run straight down them.
629
633
  */
630
634
  .dz-field {
631
635
  display: grid;
632
- grid-template-columns: 1fr 1.2fr;
636
+ grid-template-columns: 100px minmax(0, 1fr);
633
637
  align-items: center;
634
- gap: 8px;
635
- margin-bottom: 8px;
638
+ column-gap: 12px;
639
+ row-gap: 6px;
640
+ margin-bottom: 12px;
641
+ }
642
+
643
+ .dz-field:last-child {
644
+ margin-bottom: 0;
636
645
  }
637
646
 
638
647
  .dz-field label {
@@ -649,7 +658,8 @@
649
658
  .dz-field select,
650
659
  .dz-field textarea {
651
660
  width: 100%;
652
- padding: 5px 7px;
661
+ min-height: 30px;
662
+ padding: 5px 8px;
653
663
  border: 1px solid var(--border);
654
664
  border-radius: 4px;
655
665
  background: var(--surface);
@@ -670,13 +680,93 @@
670
680
  .dz-field input[type="checkbox"] {
671
681
  width: 15px;
672
682
  height: 15px;
683
+ min-height: 0;
673
684
  justify-self: start;
674
685
  accent-color: var(--accent-strong);
675
686
  }
676
687
 
688
+ /* a swatch, not a bar: a rail-wide block of black reads as a control's border */
677
689
  .dz-field input[type="color"] {
678
- height: 26px;
690
+ width: 48px;
691
+ height: 30px;
679
692
  padding: 2px;
693
+ justify-self: start;
694
+ cursor: pointer;
695
+ }
696
+
697
+ /**
698
+ * A colour control: the swatch, then either "None" or the button that takes
699
+ * the colour off. The input stays underneath the none swatch, so a click on it
700
+ * still opens the picker.
701
+ */
702
+ .dz-swatch {
703
+ display: inline-flex;
704
+ align-items: center;
705
+ gap: 8px;
706
+ justify-self: start;
707
+ }
708
+
709
+ .dz-swatch-well {
710
+ position: relative;
711
+ display: block;
712
+ width: 48px;
713
+ height: 30px;
714
+ }
715
+
716
+ .dz-swatch-well input[type="color"] {
717
+ display: block;
718
+ }
719
+
720
+ /* white with a red slash through it: the usual way of saying "no colour" */
721
+ .dz-swatch.is-none .dz-swatch-well::after {
722
+ content: "";
723
+ position: absolute;
724
+ inset: 0;
725
+ border: 1px solid var(--border);
726
+ border-radius: 4px;
727
+ background:
728
+ linear-gradient(to top right,
729
+ transparent calc(50% - 1px),
730
+ var(--danger) calc(50% - 1px),
731
+ var(--danger) calc(50% + 1px),
732
+ transparent calc(50% + 1px)),
733
+ var(--surface);
734
+ pointer-events: none;
735
+ }
736
+
737
+ .dz-swatch-none {
738
+ display: none;
739
+ color: var(--ink-soft);
740
+ font-size: 11px;
741
+ }
742
+
743
+ .dz-swatch.is-none .dz-swatch-none {
744
+ display: inline;
745
+ }
746
+
747
+ .dz-swatch .dz-swatch-clear {
748
+ margin-left: 0;
749
+ }
750
+
751
+ .dz-swatch.is-none .dz-swatch-clear {
752
+ display: none;
753
+ }
754
+
755
+ /**
756
+ * A switch reads as the box and then what it does, on one line - with the
757
+ * label in the 100px column, "New page for each group" wrapped into three.
758
+ */
759
+ .dz-panel .dz-field-toggle {
760
+ grid-template-columns: auto 1fr;
761
+ column-gap: 10px;
762
+ }
763
+
764
+ .dz-panel .dz-field-toggle input[type="checkbox"] {
765
+ order: -1;
766
+ }
767
+
768
+ .dz-panel .dz-field-toggle label {
769
+ color: var(--ink);
680
770
  cursor: pointer;
681
771
  }
682
772
 
@@ -695,6 +785,20 @@
695
785
  line-height: 1.4;
696
786
  }
697
787
 
788
+ /**
789
+ * A field's explanation is shown while that field is being used, not beside
790
+ * every field at once - a dozen paragraphs of grey were most of the rail, and
791
+ * pushed the controls apart until none could be read at a glance. The band
792
+ * list's one-line notes stay, being part of what each row says.
793
+ */
794
+ .dz-panel .dz-field > .dz-hint {
795
+ display: none;
796
+ }
797
+
798
+ .dz-panel .dz-field:focus-within > .dz-hint {
799
+ display: block;
800
+ }
801
+
698
802
  /* ---------------- the tool footer ---------------- */
699
803
 
700
804
  /**
@@ -765,40 +869,61 @@
765
869
  /* ---------------- structure controls ---------------- */
766
870
 
767
871
  /**
768
- * The right-click pill.
872
+ * The right-click menu.
769
873
  *
770
874
  * Absolute inside .dz-main rather than fixed to the window, so it scrolls out
771
875
  * of the way with the page area it belongs to and cannot be left hanging over
772
876
  * the rail. Above the selection outline and its handles, below the bar.
877
+ *
878
+ * A list of named rows - icon, name, keys - as a context menu is everywhere
879
+ * else, so what each one does is read rather than guessed from a glyph.
773
880
  */
774
881
  .dz-menu {
775
882
  position: absolute;
776
883
  z-index: 8;
777
884
 
778
885
  display: flex;
779
- align-items: center;
780
- gap: 2px;
886
+ flex-direction: column;
887
+ min-width: 200px;
781
888
  padding: 4px;
782
889
 
783
890
  border: 1px solid var(--border);
784
- border-radius: 999px;
891
+ border-radius: 8px;
785
892
  background: var(--surface);
786
893
  box-shadow: 0 8px 24px rgb(34 39 44 / .18);
894
+
895
+ font-family: "Instrument Sans", system-ui, sans-serif;
896
+ font-size: 12px;
787
897
  }
788
898
 
789
899
  .dz-menu-item {
790
- display: inline-flex;
900
+ display: grid;
901
+ grid-template-columns: 16px 1fr auto;
791
902
  align-items: center;
792
- justify-content: center;
793
- width: 30px;
903
+ gap: 10px;
794
904
  height: 30px;
905
+ padding: 0 10px;
795
906
  border: 0;
796
- border-radius: 999px;
907
+ border-radius: 5px;
797
908
  background: none;
798
- color: var(--ink-soft);
909
+ color: var(--ink);
910
+ font: inherit;
911
+ text-align: left;
912
+ white-space: nowrap;
799
913
  cursor: pointer;
800
914
  }
801
915
 
916
+ .dz-menu-icon {
917
+ display: inline-flex;
918
+ color: var(--ink-soft);
919
+ }
920
+
921
+ .dz-menu-keys {
922
+ color: var(--ink-soft);
923
+ font-family: inherit;
924
+ font-size: 11px;
925
+ }
926
+
802
927
  .dz-menu-item:hover:not(:disabled),
803
928
  .dz-menu-item:focus-visible {
804
929
  background: var(--accent-soft);
@@ -806,6 +931,11 @@
806
931
  outline: none;
807
932
  }
808
933
 
934
+ .dz-menu-item:hover:not(:disabled) .dz-menu-icon,
935
+ .dz-menu-item:focus-visible .dz-menu-icon {
936
+ color: inherit;
937
+ }
938
+
809
939
  /* the one action that cannot be taken back by moving something else */
810
940
  .dz-menu-item.is-danger:hover:not(:disabled),
811
941
  .dz-menu-item.is-danger:focus-visible {
@@ -814,14 +944,13 @@
814
944
  }
815
945
 
816
946
  .dz-menu-item:disabled {
817
- opacity: .35;
947
+ opacity: .4;
818
948
  cursor: default;
819
949
  }
820
950
 
821
951
  .dz-menu-sep {
822
- width: 1px;
823
- height: 18px;
824
- margin: 0 3px;
952
+ height: 1px;
953
+ margin: 4px 6px;
825
954
  background: var(--border);
826
955
  }
827
956
 
@@ -936,10 +1065,11 @@
936
1065
 
937
1066
  .dz-band-row {
938
1067
  display: grid;
939
- grid-template-columns: 1fr 72px;
1068
+ grid-template-columns: 1fr 64px;
940
1069
  align-items: center;
941
- gap: 6px;
942
- padding: 5px 0;
1070
+ column-gap: 10px;
1071
+ row-gap: 2px;
1072
+ padding: 6px 0;
943
1073
  }
944
1074
 
945
1075
  .dz-band-name {
@@ -963,7 +1093,8 @@
963
1093
 
964
1094
  .dz-band-height {
965
1095
  width: 100%;
966
- padding: 4px 6px;
1096
+ min-height: 28px;
1097
+ padding: 4px 8px;
967
1098
  border: 1px solid var(--border);
968
1099
  border-radius: 4px;
969
1100
  background: var(--surface);
@@ -986,11 +1117,83 @@
986
1117
 
987
1118
  .dz-band-row .dz-hint {
988
1119
  grid-column: 1 / -1;
989
- margin-top: -2px;
990
1120
  padding-left: 21px;
991
1121
  font-size: 10px;
992
1122
  }
993
1123
 
1124
+ /* ---------------- a table's grouping levels ---------------- */
1125
+
1126
+ /**
1127
+ * A card per level, as a column is a card: the levels of a nested grouping
1128
+ * read as separate things, each with its own field, order, page breaks and
1129
+ * bands, rather than one run of controls.
1130
+ */
1131
+ .dz-group-level {
1132
+ margin-bottom: 12px;
1133
+ padding: 12px;
1134
+ border: 1px solid var(--border);
1135
+ border-radius: 6px;
1136
+ background: var(--backdrop);
1137
+ }
1138
+
1139
+ .dz-group-level-head {
1140
+ display: flex;
1141
+ align-items: center;
1142
+ justify-content: space-between;
1143
+ gap: 8px;
1144
+ margin-bottom: 12px;
1145
+ padding-bottom: 10px;
1146
+ border-bottom: 1px solid var(--border);
1147
+ }
1148
+
1149
+ .dz-group-level-name {
1150
+ overflow: hidden;
1151
+ text-overflow: ellipsis;
1152
+ white-space: nowrap;
1153
+ color: var(--ink-soft);
1154
+ font-size: 10px;
1155
+ letter-spacing: .06em;
1156
+ text-transform: uppercase;
1157
+ }
1158
+
1159
+ .dz-group-level-name b {
1160
+ color: var(--ink);
1161
+ font-family: "Courier Prime", monospace;
1162
+ font-size: 12px;
1163
+ font-weight: 600;
1164
+ letter-spacing: 0;
1165
+ text-transform: none;
1166
+ }
1167
+
1168
+ /* the move and remove buttons together on the right, not pushed apart */
1169
+ .dz-group-level-actions {
1170
+ display: flex;
1171
+ flex: none;
1172
+ gap: 2px;
1173
+ }
1174
+
1175
+ .dz-group-level-actions .dz-icon {
1176
+ margin-left: 0;
1177
+ }
1178
+
1179
+ /* less the card's own padding, so its controls line up with the rail's */
1180
+ .dz-group-level .dz-field:not(.dz-field-toggle) {
1181
+ grid-template-columns: 88px minmax(0, 1fr);
1182
+ }
1183
+
1184
+ .dz-group-level .dz-band-row:last-child {
1185
+ padding-bottom: 0;
1186
+ }
1187
+
1188
+ /* the grouping section's buttons sit clear of the cards above them */
1189
+ .dz-grouping .dz-add-row {
1190
+ margin-top: 4px;
1191
+ }
1192
+
1193
+ .dz-grouping .dz-add-row + .dz-add-row {
1194
+ margin-top: 8px;
1195
+ }
1196
+
994
1197
  /* ---------------- the corner ---------------- */
995
1198
 
996
1199
  /**
@@ -1675,3 +1878,434 @@ a.dz-tool[aria-disabled="true"]:hover {
1675
1878
  background: none;
1676
1879
  color: var(--ink);
1677
1880
  }
1881
+
1882
+ /* ---------------- number and date formats ---------------- */
1883
+
1884
+ /**
1885
+ * A format's summary is the control: it reads as what the values look like,
1886
+ * and a click opens the editor. As wide as the column a control sits in.
1887
+ */
1888
+ .dz-format {
1889
+ display: flex;
1890
+ min-width: 0;
1891
+ align-items: center;
1892
+ justify-content: space-between;
1893
+ gap: 8px;
1894
+ width: 100%;
1895
+ min-height: 30px;
1896
+ padding: 5px 8px;
1897
+ border: 1px solid var(--border);
1898
+ border-radius: 4px;
1899
+ background: var(--surface);
1900
+ color: var(--ink);
1901
+ font: inherit;
1902
+ text-align: left;
1903
+ cursor: pointer;
1904
+ }
1905
+
1906
+ .dz-format:hover {
1907
+ border-color: var(--accent);
1908
+ background: var(--accent-soft);
1909
+ }
1910
+
1911
+ .dz-format:focus-visible {
1912
+ outline: 2px solid var(--accent-strong);
1913
+ outline-offset: -1px;
1914
+ }
1915
+
1916
+ .dz-format-summary {
1917
+ overflow: hidden;
1918
+ text-overflow: ellipsis;
1919
+ white-space: nowrap;
1920
+ }
1921
+
1922
+ .dz-format-edit {
1923
+ flex: none;
1924
+ color: var(--accent-ink);
1925
+ font-size: 11px;
1926
+ }
1927
+
1928
+ /* a button that belongs to a section's fields, not one that adds a row */
1929
+ .dz-section-action {
1930
+ margin-top: 4px;
1931
+ }
1932
+
1933
+ .dz-section-action::before {
1934
+ content: none;
1935
+ }
1936
+
1937
+ /* the editor: wider than the other dialogs, for two columns of choices */
1938
+ .modal-card.dz-format-card {
1939
+ width: min(480px, calc(100vw - 32px));
1940
+ }
1941
+
1942
+ /**
1943
+ * The dialog sits outside the rail, so its controls inherited the page's 16px
1944
+ * and towered over their 10px labels. 13px, as the other dialogs' choices are.
1945
+ */
1946
+ .dz-format-card .dz-field select,
1947
+ .dz-format-card .dz-field input[type="text"],
1948
+ .dz-format-card .dz-field input[type="number"] {
1949
+ min-height: 32px;
1950
+ padding: 5px 8px;
1951
+ font-size: 13px;
1952
+ }
1953
+
1954
+ .dz-format-types {
1955
+ display: flex;
1956
+ flex-wrap: wrap;
1957
+ gap: 6px;
1958
+ margin: 0 0 16px;
1959
+ padding: 0;
1960
+ border: 0;
1961
+ }
1962
+
1963
+ .dz-format-types legend {
1964
+ margin-bottom: 8px;
1965
+ color: var(--ink-soft);
1966
+ font-size: 10px;
1967
+ letter-spacing: .06em;
1968
+ text-transform: uppercase;
1969
+ }
1970
+
1971
+ /* a type is a pill; the radio inside stays for the keyboard and for forms */
1972
+ .dz-format-type {
1973
+ position: relative;
1974
+ cursor: pointer;
1975
+ }
1976
+
1977
+ .dz-format-type input {
1978
+ position: absolute;
1979
+ opacity: 0;
1980
+ pointer-events: none;
1981
+ }
1982
+
1983
+ .dz-format-type span {
1984
+ display: inline-block;
1985
+ padding: 6px 12px;
1986
+ border: 1px solid var(--border);
1987
+ border-radius: 999px;
1988
+ color: var(--ink-soft);
1989
+ font-size: 12px;
1990
+ }
1991
+
1992
+ .dz-format-type:hover span {
1993
+ border-color: var(--accent);
1994
+ }
1995
+
1996
+ .dz-format-type input:checked + span {
1997
+ border-color: var(--accent-strong);
1998
+ background: var(--accent-soft);
1999
+ color: var(--accent-ink);
2000
+ }
2001
+
2002
+ .dz-format-type input:focus-visible + span {
2003
+ outline: 2px solid var(--accent-strong);
2004
+ outline-offset: 1px;
2005
+ }
2006
+
2007
+ .dz-format-group {
2008
+ display: grid;
2009
+ grid-template-columns: 1fr 1fr;
2010
+ column-gap: 14px;
2011
+ }
2012
+
2013
+ .dz-format-group[hidden] {
2014
+ display: none;
2015
+ }
2016
+
2017
+ .dz-format-group .modal-summary {
2018
+ grid-column: 1 / -1;
2019
+ margin-top: 0;
2020
+ font-size: 11px;
2021
+ }
2022
+
2023
+ .dz-format-group .dz-field[hidden] {
2024
+ display: none;
2025
+ }
2026
+
2027
+ /* what the choices make of real values, as the report will print them */
2028
+ .dz-format-sample {
2029
+ display: flex;
2030
+ align-items: baseline;
2031
+ gap: 12px;
2032
+ margin-top: 4px;
2033
+ padding: 12px;
2034
+ border-radius: 6px;
2035
+ background: var(--backdrop);
2036
+ }
2037
+
2038
+ .dz-format-sample-label {
2039
+ flex: none;
2040
+ color: var(--ink-soft);
2041
+ font-size: 10px;
2042
+ letter-spacing: .06em;
2043
+ text-transform: uppercase;
2044
+ }
2045
+
2046
+ .dz-format-sample-values {
2047
+ display: flex;
2048
+ flex-wrap: wrap;
2049
+ gap: 6px 18px;
2050
+ font-family: "Courier Prime", monospace;
2051
+ font-size: 13px;
2052
+ font-variant-numeric: tabular-nums;
2053
+ }
2054
+
2055
+ /* the report-defaults button sits apart from the two that close the dialog */
2056
+ .dz-format-card .modal-actions [data-role="reset"] {
2057
+ margin-right: auto;
2058
+ }
2059
+
2060
+ /* a choice with Custom…: the box for the custom value sits under the select */
2061
+ .dz-choice-custom {
2062
+ display: grid;
2063
+ gap: 6px;
2064
+ }
2065
+
2066
+ .dz-choice-custom [hidden] {
2067
+ display: none;
2068
+ }
2069
+
2070
+ /* ---------------- highlight rules ---------------- */
2071
+
2072
+ /* wide enough for a rule to read as one sentence */
2073
+ .modal-card.dz-highlight-card {
2074
+ width: min(640px, calc(100vw - 32px));
2075
+ }
2076
+
2077
+ /* the dialog's own buttons and notes at the rules' size, not the page's 16px */
2078
+ .dz-highlight-card .dz-add-row {
2079
+ height: 34px;
2080
+ font-size: 13px;
2081
+ }
2082
+
2083
+ .dz-hl-rules {
2084
+ display: grid;
2085
+ gap: 10px;
2086
+ max-height: 55vh;
2087
+ margin-bottom: 12px;
2088
+ overflow-y: auto;
2089
+ }
2090
+
2091
+ /**
2092
+ * A rule is a card on a three-column grid - its label, its controls, its own
2093
+ * buttons - the same for every rule, so each control sits under the matching
2094
+ * one in the rule above whatever the label says or the test needs.
2095
+ */
2096
+ .dz-hl-rule {
2097
+ display: grid;
2098
+ grid-template-columns: 72px minmax(0, 1fr) 56px;
2099
+ align-items: center;
2100
+ column-gap: 12px;
2101
+ row-gap: 10px;
2102
+ padding: 12px 14px;
2103
+ border: 1px solid var(--border);
2104
+ border-radius: 6px;
2105
+ background: var(--backdrop);
2106
+ }
2107
+
2108
+ .dz-hl-label {
2109
+ color: var(--ink-soft);
2110
+ font-size: 11px;
2111
+ letter-spacing: .04em;
2112
+ text-transform: uppercase;
2113
+ }
2114
+
2115
+ /**
2116
+ * What to test, how, and against what. The value gets the most room: a
2117
+ * "between" puts two boxes and an "and" in it, and the dropdowns' longest
2118
+ * choice is "is not empty".
2119
+ */
2120
+ .dz-hl-when {
2121
+ display: grid;
2122
+ grid-template-columns: minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.4fr);
2123
+ gap: 8px;
2124
+ }
2125
+
2126
+ .dz-hl-values {
2127
+ display: flex;
2128
+ align-items: center;
2129
+ gap: 6px;
2130
+ min-width: 0;
2131
+ }
2132
+
2133
+ .dz-hl-values input {
2134
+ flex: 1;
2135
+ min-width: 0;
2136
+ }
2137
+
2138
+ .dz-hl-and {
2139
+ flex: none;
2140
+ color: var(--ink-soft);
2141
+ font-size: 12px;
2142
+ }
2143
+
2144
+ .dz-hl-novalue {
2145
+ color: var(--ink-soft);
2146
+ font-size: 12px;
2147
+ font-style: italic;
2148
+ }
2149
+
2150
+ /* every control one height, one border, one type size */
2151
+ .dz-hl-rule select,
2152
+ .dz-hl-rule input[type="text"] {
2153
+ width: 100%;
2154
+ height: 32px;
2155
+ padding: 0 8px;
2156
+ border: 1px solid var(--border);
2157
+ border-radius: 4px;
2158
+ background: var(--surface);
2159
+ color: var(--ink);
2160
+ font: inherit;
2161
+ font-size: 13px;
2162
+ }
2163
+
2164
+ .dz-hl-rule select:focus-visible,
2165
+ .dz-hl-rule input[type="text"]:focus-visible,
2166
+ .dz-hl-toggle:focus-visible {
2167
+ outline: 2px solid var(--accent-strong);
2168
+ outline-offset: -1px;
2169
+ border-color: var(--accent-strong);
2170
+ }
2171
+
2172
+ .dz-hl-actions {
2173
+ display: flex;
2174
+ justify-content: flex-end;
2175
+ gap: 4px;
2176
+ }
2177
+
2178
+ .dz-hl-actions .dz-icon,
2179
+ .dz-hl-slot {
2180
+ width: 24px;
2181
+ height: 24px;
2182
+ margin-left: 0;
2183
+ }
2184
+
2185
+ /* the style line: colours, then weight and slant, then the sample at the end */
2186
+ .dz-hl-style {
2187
+ display: flex;
2188
+ align-items: center;
2189
+ gap: 14px;
2190
+ min-width: 0;
2191
+ }
2192
+
2193
+ .dz-hl-color {
2194
+ display: inline-flex;
2195
+ align-items: center;
2196
+ gap: 6px;
2197
+ }
2198
+
2199
+ .dz-hl-color-label {
2200
+ color: var(--ink-soft);
2201
+ font-size: 12px;
2202
+ }
2203
+
2204
+ .dz-hl-rule .dz-swatch {
2205
+ gap: 2px;
2206
+ }
2207
+
2208
+ .dz-hl-rule .dz-swatch-well,
2209
+ .dz-hl-rule .dz-swatch-well input[type="color"] {
2210
+ width: 40px;
2211
+ height: 32px;
2212
+ }
2213
+
2214
+ .dz-hl-rule .dz-swatch-well input[type="color"] {
2215
+ padding: 3px;
2216
+ border: 1px solid var(--border);
2217
+ border-radius: 4px;
2218
+ background: var(--surface);
2219
+ cursor: pointer;
2220
+ }
2221
+
2222
+ /**
2223
+ * The clear button keeps its place when there is no colour to clear, so the
2224
+ * fill, the toggles and the sample never shift from one rule to the next.
2225
+ */
2226
+ .dz-hl-rule .dz-swatch.is-none .dz-swatch-clear {
2227
+ display: inline-flex;
2228
+ visibility: hidden;
2229
+ }
2230
+
2231
+ .dz-hl-rule .dz-swatch-clear {
2232
+ width: 20px;
2233
+ height: 20px;
2234
+ margin-left: 0;
2235
+ }
2236
+
2237
+ .dz-hl-toggles {
2238
+ display: inline-flex;
2239
+ gap: 4px;
2240
+ }
2241
+
2242
+ .dz-hl-toggle {
2243
+ width: 32px;
2244
+ height: 32px;
2245
+ border: 1px solid var(--border);
2246
+ border-radius: 4px;
2247
+ background: var(--surface);
2248
+ color: var(--ink);
2249
+ font: inherit;
2250
+ font-size: 13px;
2251
+ cursor: pointer;
2252
+ }
2253
+
2254
+ .dz-hl-toggle:hover {
2255
+ border-color: var(--accent);
2256
+ }
2257
+
2258
+ .dz-hl-toggle[aria-pressed="true"] {
2259
+ border-color: var(--accent-strong);
2260
+ background: var(--accent-soft);
2261
+ color: var(--accent-ink);
2262
+ }
2263
+
2264
+ /* what the rule does to a value, in the rule's own style, at the line's end */
2265
+ .dz-hl-preview {
2266
+ display: inline-flex;
2267
+ align-items: center;
2268
+ justify-content: flex-end;
2269
+ flex: 1;
2270
+ min-width: 0;
2271
+ height: 32px;
2272
+ padding: 0 10px;
2273
+ overflow: hidden;
2274
+ border: 1px dashed var(--border);
2275
+ border-radius: 4px;
2276
+ background: var(--surface);
2277
+ font-family: "Courier Prime", monospace;
2278
+ font-size: 13px;
2279
+ white-space: nowrap;
2280
+ }
2281
+
2282
+ /* a group band's row: its name, its background, its height */
2283
+ .dz-band-row.has-fill {
2284
+ grid-template-columns: 1fr auto 64px;
2285
+ }
2286
+
2287
+ .dz-band-fill .dz-swatch-well,
2288
+ .dz-band-fill .dz-swatch-well input[type="color"] {
2289
+ width: 36px;
2290
+ height: 28px;
2291
+ }
2292
+
2293
+ .dz-band-fill .dz-swatch-well input[type="color"] {
2294
+ padding: 2px;
2295
+ border: 1px solid var(--border);
2296
+ border-radius: 4px;
2297
+ background: var(--surface);
2298
+ cursor: pointer;
2299
+ }
2300
+
2301
+ /* the clear button keeps its place, so the height box never moves */
2302
+ .dz-band-fill.is-none .dz-swatch-clear {
2303
+ display: inline-flex;
2304
+ visibility: hidden;
2305
+ }
2306
+
2307
+ .dz-band-fill .dz-swatch-clear {
2308
+ width: 18px;
2309
+ height: 18px;
2310
+ margin-left: 0;
2311
+ }