@speles7172/controls 0.2.1 → 0.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 (49) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/Badge.d.ts +45 -0
  3. package/dist/Badge.d.ts.map +1 -0
  4. package/dist/Badge.js +51 -0
  5. package/dist/Badge.js.map +1 -0
  6. package/dist/Card.d.ts +52 -0
  7. package/dist/Card.d.ts.map +1 -0
  8. package/dist/Card.js +25 -0
  9. package/dist/Card.js.map +1 -0
  10. package/dist/DataTable.d.ts +99 -0
  11. package/dist/DataTable.d.ts.map +1 -0
  12. package/dist/DataTable.js +93 -0
  13. package/dist/DataTable.js.map +1 -0
  14. package/dist/KeyValueList.d.ts.map +1 -1
  15. package/dist/KeyValueList.js +2 -1
  16. package/dist/KeyValueList.js.map +1 -1
  17. package/dist/PageHeader.d.ts +36 -0
  18. package/dist/PageHeader.d.ts.map +1 -0
  19. package/dist/PageHeader.js +24 -0
  20. package/dist/PageHeader.js.map +1 -0
  21. package/dist/ProgressBar.d.ts +36 -0
  22. package/dist/ProgressBar.d.ts.map +1 -0
  23. package/dist/ProgressBar.js +34 -0
  24. package/dist/ProgressBar.js.map +1 -0
  25. package/dist/SearchableMultiSelect.d.ts.map +1 -1
  26. package/dist/SearchableMultiSelect.js +3 -2
  27. package/dist/SearchableMultiSelect.js.map +1 -1
  28. package/dist/Section.d.ts +34 -0
  29. package/dist/Section.d.ts.map +1 -0
  30. package/dist/Section.js +21 -0
  31. package/dist/Section.js.map +1 -0
  32. package/dist/Tabs.d.ts +37 -0
  33. package/dist/Tabs.d.ts.map +1 -0
  34. package/dist/Tabs.js +55 -0
  35. package/dist/Tabs.js.map +1 -0
  36. package/dist/icons.d.ts +37 -0
  37. package/dist/icons.d.ts.map +1 -0
  38. package/dist/icons.js +45 -0
  39. package/dist/icons.js.map +1 -0
  40. package/dist/index.d.ts +28 -5
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +28 -5
  43. package/dist/index.js.map +1 -1
  44. package/dist/states.d.ts +65 -0
  45. package/dist/states.d.ts.map +1 -0
  46. package/dist/states.js +38 -0
  47. package/dist/states.js.map +1 -0
  48. package/dist/styles.css +747 -22
  49. package/package.json +4 -3
package/dist/styles.css CHANGED
@@ -22,28 +22,89 @@
22
22
  */
23
23
 
24
24
  .ctl {
25
+ /*
26
+ * The neutral ramp. Four steps and a fifth for icons at rest: a page built
27
+ * from more greys than this reads as five different pages.
28
+ */
25
29
  --ctl-bg: #ffffff;
26
30
  --ctl-surface: #f8fafc;
27
31
  --ctl-border: #e2e8f0;
28
32
  --ctl-text: #0f172a;
29
33
  --ctl-muted: #64748b;
34
+ --ctl-faint: #94a3b8;
35
+
36
+ /* One accent, and it means "you can act on this". */
30
37
  --ctl-accent: #2563eb;
38
+ --ctl-accent-strong: #1d4ed8;
31
39
  --ctl-accent-soft: #eff6ff;
40
+ --ctl-accent-text: #ffffff;
41
+
42
+ /*
43
+ * The status ramp — green, amber, red — and nothing else on a screen is
44
+ * coloured. A hue that carries no meaning spends the only signal there is.
45
+ */
46
+ --ctl-ok: #15803d;
47
+ --ctl-ok-soft: #f0fdf4;
48
+ --ctl-warn: #b45309;
49
+ --ctl-warn-soft: #fffbeb;
50
+ --ctl-danger: #b91c1c;
51
+ --ctl-danger-soft: #fef2f2;
52
+
32
53
  --ctl-mark-bg: #fef08a;
33
54
  --ctl-mark-text: #422006;
34
- --ctl-error-text: #b91c1c;
35
- --ctl-error-soft: #fef2f2;
55
+
56
+ /* The washes a row, a card or an option is picked out with. */
57
+ --ctl-hover: rgb(15 23 42 / 4%);
58
+ --ctl-selected: rgb(37 99 235 / 8%);
59
+
60
+ /*
61
+ * The radius language: 6 for a control, 8 for a card, 12 for a dialog, and a
62
+ * pill for anything that reads as a token — a badge, a chip, a progress bar.
63
+ */
64
+ --ctl-radius-sm: 6px;
36
65
  --ctl-radius: 8px;
66
+ --ctl-radius-lg: 12px;
67
+ --ctl-radius-pill: 999px;
68
+
69
+ /*
70
+ * Elevation. The border does the work; a shadow only lifts a card off the
71
+ * page on hover, and `--ctl-shadow` is reserved for the two things that
72
+ * genuinely float — a popover and a dialog.
73
+ */
74
+ --ctl-shadow-card: 0 1px 2px rgb(15 23 42 / 4%);
75
+ --ctl-shadow-hover: 0 4px 12px rgb(15 23 42 / 8%);
37
76
  --ctl-shadow: 0 8px 24px rgb(15 23 42 / 12%);
38
77
  --ctl-overlay: rgb(15 23 42 / 45%);
39
78
 
79
+ /*
80
+ * The 4px space scale. Every gap and every padding in this stylesheet is one
81
+ * of these six values, which is most of why a screen made of these parts
82
+ * looks deliberate rather than assembled.
83
+ */
84
+ --ctl-space-1: 4px;
85
+ --ctl-space-2: 8px;
86
+ --ctl-space-3: 12px;
87
+ --ctl-space-4: 16px;
88
+ --ctl-space-5: 24px;
89
+ --ctl-space-6: 32px;
90
+
91
+ /*
92
+ * The type scale. A title in medium weight, a quiet line under it, and small
93
+ * caps for a column head — the three sizes a console actually needs.
94
+ */
95
+ --ctl-text-xs: 11px;
96
+ --ctl-text-sm: 12px;
97
+ --ctl-text-base: 14px;
98
+ --ctl-text-lg: 16px;
99
+ --ctl-text-title: 20px;
100
+
40
101
  color: var(--ctl-text);
41
102
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
42
- font-size: 14px;
103
+ font-size: var(--ctl-text-base);
43
104
  position: relative;
44
105
  display: flex;
45
106
  flex-direction: column;
46
- gap: 4px;
107
+ gap: var(--ctl-space-1);
47
108
  }
48
109
 
49
110
  .ctl:where([data-ctl-theme="dark"]) {
@@ -52,12 +113,23 @@
52
113
  --ctl-border: #334155;
53
114
  --ctl-text: #e2e8f0;
54
115
  --ctl-muted: #94a3b8;
116
+ --ctl-faint: #64748b;
55
117
  --ctl-accent: #60a5fa;
118
+ --ctl-accent-strong: #93c5fd;
56
119
  --ctl-accent-soft: #1e3a5f;
120
+ --ctl-accent-text: #0f172a;
121
+ --ctl-ok: #4ade80;
122
+ --ctl-ok-soft: #052e16;
123
+ --ctl-warn: #fbbf24;
124
+ --ctl-warn-soft: #451a03;
125
+ --ctl-danger: #fca5a5;
126
+ --ctl-danger-soft: #450a0a;
57
127
  --ctl-mark-bg: #854d0e;
58
128
  --ctl-mark-text: #fef9c3;
59
- --ctl-error-text: #fca5a5;
60
- --ctl-error-soft: #450a0a;
129
+ --ctl-hover: rgb(226 232 240 / 6%);
130
+ --ctl-selected: rgb(96 165 250 / 14%);
131
+ --ctl-shadow-card: 0 1px 2px rgb(0 0 0 / 30%);
132
+ --ctl-shadow-hover: 0 4px 12px rgb(0 0 0 / 45%);
61
133
  --ctl-shadow: 0 8px 24px rgb(0 0 0 / 45%);
62
134
  --ctl-overlay: rgb(0 0 0 / 65%);
63
135
  }
@@ -69,14 +141,25 @@
69
141
  --ctl-border: #334155;
70
142
  --ctl-text: #e2e8f0;
71
143
  --ctl-muted: #94a3b8;
144
+ --ctl-faint: #64748b;
72
145
  --ctl-accent: #60a5fa;
146
+ --ctl-accent-strong: #93c5fd;
73
147
  --ctl-accent-soft: #1e3a5f;
148
+ --ctl-accent-text: #0f172a;
149
+ --ctl-ok: #4ade80;
150
+ --ctl-ok-soft: #052e16;
151
+ --ctl-warn: #fbbf24;
152
+ --ctl-warn-soft: #451a03;
153
+ --ctl-danger: #fca5a5;
154
+ --ctl-danger-soft: #450a0a;
74
155
  --ctl-mark-bg: #854d0e;
75
156
  --ctl-mark-text: #fef9c3;
76
- --ctl-error-text: #fca5a5;
77
- --ctl-error-soft: #450a0a;
157
+ --ctl-hover: rgb(226 232 240 / 6%);
158
+ --ctl-selected: rgb(96 165 250 / 14%);
159
+ --ctl-shadow-card: 0 1px 2px rgb(0 0 0 / 30%);
160
+ --ctl-shadow-hover: 0 4px 12px rgb(0 0 0 / 45%);
78
161
  --ctl-shadow: 0 8px 24px rgb(0 0 0 / 45%);
79
- --ctl-overlay: rgb(0 0 0 / 65%);
162
+ --ctl-overlay: rgb(0 0 0 / 65%);
80
163
  }
81
164
  }
82
165
 
@@ -153,11 +236,14 @@
153
236
  }
154
237
 
155
238
  .ctl-icon-button {
156
- padding: 0 3px;
157
- font-size: 12px;
158
- line-height: 1;
239
+ display: flex;
240
+ align-items: center;
241
+ justify-content: center;
242
+ padding: var(--ctl-space-1);
243
+ line-height: 0;
244
+ color: var(--ctl-muted);
159
245
  cursor: pointer;
160
- border-radius: 4px;
246
+ border-radius: var(--ctl-radius-sm);
161
247
  }
162
248
 
163
249
  .ctl-icon-button:hover {
@@ -166,7 +252,9 @@
166
252
  }
167
253
 
168
254
  .ctl-caret {
169
- font-size: 11px;
255
+ display: flex;
256
+ flex-shrink: 0;
257
+ color: var(--ctl-faint);
170
258
  }
171
259
 
172
260
  /* Selected values, so a multi-select says what is in it. */
@@ -198,15 +286,17 @@
198
286
  }
199
287
 
200
288
  .ctl-chip-remove {
201
- padding: 0 2px;
289
+ display: flex;
290
+ align-items: center;
291
+ justify-content: center;
292
+ padding: 2px;
202
293
  font: inherit;
203
- font-size: 10px;
204
- line-height: 1;
294
+ line-height: 0;
205
295
  color: inherit;
206
296
  cursor: pointer;
207
297
  background: none;
208
298
  border: none;
209
- border-radius: 999px;
299
+ border-radius: var(--ctl-radius-pill);
210
300
  }
211
301
 
212
302
  .ctl-chip-remove:hover:not(:disabled) {
@@ -314,8 +404,15 @@
314
404
  }
315
405
 
316
406
  .ctl-check {
407
+ display: flex;
317
408
  flex-shrink: 0;
318
- line-height: 1.4;
409
+ align-items: center;
410
+ height: 20px;
411
+ color: var(--ctl-faint);
412
+ }
413
+
414
+ .ctl-option-selected .ctl-check {
415
+ color: var(--ctl-accent);
319
416
  }
320
417
 
321
418
  .ctl-option-text {
@@ -350,7 +447,7 @@
350
447
  }
351
448
 
352
449
  .ctl-error {
353
- color: var(--ctl-error-text);
450
+ color: var(--ctl-danger);
354
451
  }
355
452
 
356
453
  .ctl-popover-footer:not(:empty) {
@@ -413,7 +510,7 @@
413
510
 
414
511
  .ctl-input[aria-invalid="true"],
415
512
  .ctl-textarea[aria-invalid="true"] {
416
- border-color: var(--ctl-error-text);
513
+ border-color: var(--ctl-danger);
417
514
  }
418
515
 
419
516
  .ctl-textarea {
@@ -475,7 +572,7 @@
475
572
  .ctl-kv-duplicate {
476
573
  padding: 2px;
477
574
  margin: -2px;
478
- background: var(--ctl-error-soft);
575
+ background: var(--ctl-danger-soft);
479
576
  border-radius: var(--ctl-radius);
480
577
  }
481
578
 
@@ -622,3 +719,631 @@
622
719
  border-radius: 0;
623
720
  }
624
721
  }
722
+
723
+ /* ─────────────────────────────────────────────────────────────────────────
724
+ * The screen primitives.
725
+ *
726
+ * Everything above this line is a form control. Everything below is the
727
+ * furniture a console is built out of — the header that says what the screen
728
+ * is, the table every list is, the states that are not the happy one. They
729
+ * live here for the reason the package exists: written twice, they behave
730
+ * differently in two places, and a console that rolls its own table is a
731
+ * console whose rows are a different height from every other console's.
732
+ *
733
+ * See docs/UI.md.
734
+ * ───────────────────────────────────────────────────────────────────────── */
735
+
736
+ /* A card: the primary visual unit. The border does the work. */
737
+ .ctl-card {
738
+ display: flex;
739
+ flex-direction: column;
740
+ gap: var(--ctl-space-2);
741
+ padding: var(--ctl-space-4);
742
+ background: var(--ctl-bg);
743
+ border: 1px solid var(--ctl-border);
744
+ border-radius: var(--ctl-radius);
745
+ box-shadow: var(--ctl-shadow-card);
746
+ }
747
+
748
+ .ctl-card-compact {
749
+ gap: var(--ctl-space-1);
750
+ padding: var(--ctl-space-3);
751
+ }
752
+
753
+ /* Clickable cards lift; static ones never do. */
754
+ .ctl-card-clickable {
755
+ position: relative;
756
+ cursor: pointer;
757
+ transition:
758
+ box-shadow 120ms ease,
759
+ border-color 120ms ease;
760
+ }
761
+
762
+ .ctl-card-clickable:hover {
763
+ border-color: var(--ctl-accent);
764
+ box-shadow: var(--ctl-shadow-hover);
765
+ }
766
+
767
+ /*
768
+ * The title is the control, stretched over the whole card — so the card is one
769
+ * big target and an action button inside it is still its own control, which a
770
+ * `<button>` wrapping the card cannot be.
771
+ */
772
+ .ctl-card-open {
773
+ padding: 0;
774
+ font: inherit;
775
+ color: inherit;
776
+ text-align: left;
777
+ cursor: pointer;
778
+ background: none;
779
+ border: 0;
780
+ }
781
+
782
+ .ctl-card-open::after {
783
+ position: absolute;
784
+ inset: 0;
785
+ content: "";
786
+ }
787
+
788
+ /* The ring belongs to the card, because the hit area is the card. */
789
+ .ctl-card-clickable:has(.ctl-card-open:focus-visible) {
790
+ outline: 2px solid var(--ctl-accent);
791
+ outline-offset: 2px;
792
+ }
793
+
794
+ .ctl-card-open:focus-visible {
795
+ outline: none;
796
+ }
797
+
798
+ .ctl-card-head {
799
+ display: flex;
800
+ gap: var(--ctl-space-3);
801
+ align-items: flex-start;
802
+ justify-content: space-between;
803
+ }
804
+
805
+ .ctl-card-title {
806
+ margin: 0;
807
+ font-size: var(--ctl-text-base);
808
+ font-weight: 600;
809
+ }
810
+
811
+ .ctl-card-lead {
812
+ margin: 0;
813
+ font-size: var(--ctl-text-sm);
814
+ color: var(--ctl-muted);
815
+ }
816
+
817
+ .ctl-card-actions {
818
+ /* Positioned above the stretched hit area, or a clickable card swallows every
819
+ click meant for the buttons inside it. */
820
+ position: relative;
821
+ z-index: 1;
822
+ display: flex;
823
+ flex-shrink: 0;
824
+ gap: var(--ctl-space-1);
825
+ align-items: center;
826
+ }
827
+
828
+ /*
829
+ * Every screen states what it is: a title in medium weight and one quiet line
830
+ * under it. The count sits beside the title rather than under it, because
831
+ * "how many" is part of what the screen is.
832
+ */
833
+ .ctl-page-head {
834
+ /* `.ctl` is a form control by default — a column with a 4px gap. Every
835
+ primitive below that is not one says so explicitly. */
836
+ display: flex;
837
+ flex-direction: row;
838
+ flex-wrap: wrap;
839
+ gap: var(--ctl-space-3);
840
+ align-items: flex-start;
841
+ justify-content: space-between;
842
+ margin-bottom: var(--ctl-space-4);
843
+ }
844
+
845
+ .ctl-page-heading {
846
+ display: flex;
847
+ flex-direction: column;
848
+ gap: var(--ctl-space-1);
849
+ min-width: 0;
850
+ }
851
+
852
+ .ctl-page-title {
853
+ display: flex;
854
+ gap: var(--ctl-space-2);
855
+ align-items: baseline;
856
+ margin: 0;
857
+ font-size: var(--ctl-text-title);
858
+ font-weight: 600;
859
+ line-height: 1.25;
860
+ }
861
+
862
+ .ctl-page-count {
863
+ font-size: var(--ctl-text-base);
864
+ font-weight: 400;
865
+ color: var(--ctl-muted);
866
+ }
867
+
868
+ .ctl-page-lead {
869
+ max-width: 76ch;
870
+ margin: 0;
871
+ font-size: var(--ctl-text-base);
872
+ line-height: 1.5;
873
+ color: var(--ctl-muted);
874
+ }
875
+
876
+ .ctl-page-actions {
877
+ display: flex;
878
+ flex-wrap: wrap;
879
+ gap: var(--ctl-space-2);
880
+ align-items: center;
881
+ }
882
+
883
+ /* A section inside a screen: heading, count, and the rhythm between them. */
884
+ .ctl-section {
885
+ display: flex;
886
+ flex-direction: column;
887
+ gap: var(--ctl-space-3);
888
+ margin-top: var(--ctl-space-6);
889
+ }
890
+
891
+ .ctl-section-head {
892
+ display: flex;
893
+ flex-wrap: wrap;
894
+ gap: var(--ctl-space-2);
895
+ align-items: center;
896
+ justify-content: space-between;
897
+ }
898
+
899
+ .ctl-section-toggle {
900
+ display: flex;
901
+ gap: var(--ctl-space-2);
902
+ align-items: center;
903
+ padding: 0;
904
+ font: inherit;
905
+ color: inherit;
906
+ cursor: pointer;
907
+ background: none;
908
+ border: 0;
909
+ border-radius: var(--ctl-radius-sm);
910
+ }
911
+
912
+ .ctl-section-toggle:focus-visible {
913
+ outline: 2px solid var(--ctl-accent);
914
+ outline-offset: 3px;
915
+ }
916
+
917
+ .ctl-section-icon {
918
+ display: flex;
919
+ flex-shrink: 0;
920
+ color: var(--ctl-faint);
921
+ }
922
+
923
+ .ctl-section-title {
924
+ margin: 0;
925
+ font-size: var(--ctl-text-lg);
926
+ font-weight: 600;
927
+ }
928
+
929
+ .ctl-section-count {
930
+ font-size: var(--ctl-text-base);
931
+ font-weight: 400;
932
+ color: var(--ctl-muted);
933
+ }
934
+
935
+ .ctl-section-actions {
936
+ display: flex;
937
+ gap: var(--ctl-space-2);
938
+ align-items: center;
939
+ }
940
+
941
+ .ctl-section-body {
942
+ display: flex;
943
+ flex-direction: column;
944
+ gap: var(--ctl-space-3);
945
+ }
946
+
947
+ /* Tabs: a rail under the active one, in the accent, and nothing else. */
948
+ .ctl-tabs {
949
+ display: flex;
950
+ flex-direction: row;
951
+ gap: var(--ctl-space-1);
952
+ overflow-x: auto;
953
+ border-bottom: 1px solid var(--ctl-border);
954
+ }
955
+
956
+ .ctl-tab {
957
+ display: flex;
958
+ gap: var(--ctl-space-2);
959
+ align-items: center;
960
+ padding: var(--ctl-space-2) var(--ctl-space-3);
961
+ font: inherit;
962
+ font-weight: 500;
963
+ color: var(--ctl-muted);
964
+ white-space: nowrap;
965
+ cursor: pointer;
966
+ background: none;
967
+ border: 0;
968
+ border-bottom: 2px solid transparent;
969
+ margin-bottom: -1px;
970
+ }
971
+
972
+ .ctl-tab:hover {
973
+ color: var(--ctl-text);
974
+ border-bottom-color: var(--ctl-border);
975
+ }
976
+
977
+ .ctl-tab:focus-visible {
978
+ outline: 2px solid var(--ctl-accent);
979
+ outline-offset: -2px;
980
+ }
981
+
982
+ .ctl-tab-active,
983
+ .ctl-tab-active:hover {
984
+ color: var(--ctl-accent);
985
+ border-bottom-color: var(--ctl-accent);
986
+ }
987
+
988
+ .ctl-tab-count {
989
+ font-size: var(--ctl-text-sm);
990
+ color: var(--ctl-muted);
991
+ }
992
+
993
+ /* A badge is a pill, and its colour is the whole of what it says. */
994
+ .ctl-badge {
995
+ display: inline-flex;
996
+ gap: var(--ctl-space-1);
997
+ align-items: center;
998
+ padding: 2px var(--ctl-space-2);
999
+ font-size: var(--ctl-text-sm);
1000
+ font-weight: 500;
1001
+ line-height: 1.5;
1002
+ white-space: nowrap;
1003
+ border-radius: var(--ctl-radius-pill);
1004
+ }
1005
+
1006
+ .ctl-badge-neutral {
1007
+ color: var(--ctl-muted);
1008
+ background: var(--ctl-surface);
1009
+ }
1010
+
1011
+ .ctl-badge-accent {
1012
+ color: var(--ctl-accent);
1013
+ background: var(--ctl-accent-soft);
1014
+ }
1015
+
1016
+ .ctl-badge-ok {
1017
+ color: var(--ctl-ok);
1018
+ background: var(--ctl-ok-soft);
1019
+ }
1020
+
1021
+ .ctl-badge-warn {
1022
+ color: var(--ctl-warn);
1023
+ background: var(--ctl-warn-soft);
1024
+ }
1025
+
1026
+ .ctl-badge-danger {
1027
+ color: var(--ctl-danger);
1028
+ background: var(--ctl-danger-soft);
1029
+ }
1030
+
1031
+ .ctl-badge-dot {
1032
+ width: 6px;
1033
+ height: 6px;
1034
+ background: currentcolor;
1035
+ border-radius: var(--ctl-radius-pill);
1036
+ }
1037
+
1038
+ /* A progress bar reads at a glance or not at all: pill track, one fill. */
1039
+ .ctl-progress {
1040
+ display: flex;
1041
+ flex-direction: column;
1042
+ gap: var(--ctl-space-1);
1043
+ }
1044
+
1045
+ .ctl-progress-meta {
1046
+ display: flex;
1047
+ gap: var(--ctl-space-2);
1048
+ justify-content: space-between;
1049
+ font-size: var(--ctl-text-sm);
1050
+ color: var(--ctl-muted);
1051
+ }
1052
+
1053
+ .ctl-progress-track {
1054
+ height: 6px;
1055
+ overflow: hidden;
1056
+ background: var(--ctl-surface);
1057
+ border-radius: var(--ctl-radius-pill);
1058
+ }
1059
+
1060
+ .ctl-progress-fill {
1061
+ height: 100%;
1062
+ background: var(--ctl-accent);
1063
+ border-radius: var(--ctl-radius-pill);
1064
+ transition: width 200ms ease;
1065
+ }
1066
+
1067
+ .ctl-progress-ok .ctl-progress-fill {
1068
+ background: var(--ctl-ok);
1069
+ }
1070
+
1071
+ .ctl-progress-warn .ctl-progress-fill {
1072
+ background: var(--ctl-warn);
1073
+ }
1074
+
1075
+ .ctl-progress-danger .ctl-progress-fill {
1076
+ background: var(--ctl-danger);
1077
+ }
1078
+
1079
+ /*
1080
+ * Every list is this table. Column heads are small caps in the muted colour,
1081
+ * cells are the base size, and a clickable row says so with the cursor and a
1082
+ * wash rather than with a link-blue label.
1083
+ */
1084
+ .ctl-table-wrap {
1085
+ display: block;
1086
+ width: 100%;
1087
+ overflow-x: auto;
1088
+ background: var(--ctl-bg);
1089
+ border: 1px solid var(--ctl-border);
1090
+ border-radius: var(--ctl-radius);
1091
+ }
1092
+
1093
+ .ctl-table {
1094
+ width: 100%;
1095
+ border-collapse: collapse;
1096
+ }
1097
+
1098
+ .ctl-table thead {
1099
+ background: var(--ctl-surface);
1100
+ }
1101
+
1102
+ .ctl-th {
1103
+ padding: var(--ctl-space-2) var(--ctl-space-3);
1104
+ font-size: var(--ctl-text-xs);
1105
+ font-weight: 600;
1106
+ color: var(--ctl-muted);
1107
+ text-align: left;
1108
+ text-transform: uppercase;
1109
+ letter-spacing: 0.04em;
1110
+ white-space: nowrap;
1111
+ border-bottom: 1px solid var(--ctl-border);
1112
+ }
1113
+
1114
+ .ctl-th-button {
1115
+ display: inline-flex;
1116
+ gap: var(--ctl-space-1);
1117
+ align-items: center;
1118
+ padding: 0;
1119
+ font: inherit;
1120
+ color: inherit;
1121
+ text-transform: inherit;
1122
+ letter-spacing: inherit;
1123
+ cursor: pointer;
1124
+ background: none;
1125
+ border: 0;
1126
+ border-radius: var(--ctl-radius-sm);
1127
+ }
1128
+
1129
+ .ctl-th-button:hover {
1130
+ color: var(--ctl-text);
1131
+ }
1132
+
1133
+ .ctl-th-button:focus-visible {
1134
+ outline: 2px solid var(--ctl-accent);
1135
+ outline-offset: 2px;
1136
+ }
1137
+
1138
+ .ctl-th-icon {
1139
+ display: flex;
1140
+ color: var(--ctl-faint);
1141
+ }
1142
+
1143
+ .ctl-th-icon-active {
1144
+ color: var(--ctl-accent);
1145
+ }
1146
+
1147
+ .ctl-td {
1148
+ padding: var(--ctl-space-3);
1149
+ font-size: var(--ctl-text-base);
1150
+ vertical-align: top;
1151
+ border-top: 1px solid var(--ctl-border);
1152
+ }
1153
+
1154
+ .ctl-table tbody tr:first-child .ctl-td {
1155
+ border-top: 0;
1156
+ }
1157
+
1158
+ .ctl-align-right {
1159
+ text-align: right;
1160
+ }
1161
+
1162
+ .ctl-align-center {
1163
+ text-align: center;
1164
+ }
1165
+
1166
+ .ctl-row:hover {
1167
+ background: var(--ctl-hover);
1168
+ }
1169
+
1170
+ .ctl-row-clickable {
1171
+ cursor: pointer;
1172
+ }
1173
+
1174
+ .ctl-row-clickable:focus-visible {
1175
+ outline: 2px solid var(--ctl-accent);
1176
+ outline-offset: -2px;
1177
+ }
1178
+
1179
+ .ctl-row-selected,
1180
+ .ctl-row-selected:hover {
1181
+ background: var(--ctl-selected);
1182
+ }
1183
+
1184
+ /*
1185
+ * Actions appear on hover, and on focus-within so a keyboard reaches them. A
1186
+ * row with five permanently visible icon buttons is a row nobody can scan.
1187
+ */
1188
+ .ctl-row-actions {
1189
+ display: flex;
1190
+ gap: var(--ctl-space-1);
1191
+ justify-content: flex-end;
1192
+ opacity: 0;
1193
+ transition: opacity 120ms ease;
1194
+ }
1195
+
1196
+ .ctl-row:hover .ctl-row-actions,
1197
+ .ctl-row:focus-within .ctl-row-actions,
1198
+ .ctl-card:hover .ctl-row-actions,
1199
+ .ctl-card:focus-within .ctl-row-actions {
1200
+ opacity: 1;
1201
+ }
1202
+
1203
+ /* Touch has no hover: never hide an action behind one. */
1204
+ @media (hover: none) {
1205
+ .ctl-row-actions {
1206
+ opacity: 1;
1207
+ }
1208
+ }
1209
+
1210
+ .ctl-table-empty {
1211
+ padding: var(--ctl-space-6) var(--ctl-space-3);
1212
+ text-align: center;
1213
+ }
1214
+
1215
+ /*
1216
+ * Every state is designed, not just the happy one. An empty list rendering as
1217
+ * blank space is a bug: it says what this place is for and offers the action
1218
+ * that fills it.
1219
+ */
1220
+ .ctl-empty {
1221
+ display: flex;
1222
+ flex-direction: column;
1223
+ gap: var(--ctl-space-2);
1224
+ align-items: center;
1225
+ padding: var(--ctl-space-6) var(--ctl-space-4);
1226
+ text-align: center;
1227
+ }
1228
+
1229
+ .ctl-empty-icon {
1230
+ display: flex;
1231
+ align-items: center;
1232
+ justify-content: center;
1233
+ width: 40px;
1234
+ height: 40px;
1235
+ color: var(--ctl-faint);
1236
+ background: var(--ctl-surface);
1237
+ border-radius: var(--ctl-radius-pill);
1238
+ }
1239
+
1240
+ .ctl-empty-title {
1241
+ margin: 0;
1242
+ font-size: var(--ctl-text-base);
1243
+ font-weight: 600;
1244
+ }
1245
+
1246
+ .ctl-empty-lead {
1247
+ max-width: 46ch;
1248
+ margin: 0;
1249
+ font-size: var(--ctl-text-sm);
1250
+ color: var(--ctl-muted);
1251
+ }
1252
+
1253
+ .ctl-empty-action {
1254
+ margin-top: var(--ctl-space-1);
1255
+ }
1256
+
1257
+ /* Loading gets a shape, not a jump. */
1258
+ .ctl-skeleton {
1259
+ background: linear-gradient(
1260
+ 90deg,
1261
+ var(--ctl-surface) 25%,
1262
+ var(--ctl-hover) 37%,
1263
+ var(--ctl-surface) 63%
1264
+ );
1265
+ background-size: 400% 100%;
1266
+ border-radius: var(--ctl-radius-sm);
1267
+ animation: ctl-shimmer 1.4s ease infinite;
1268
+ }
1269
+
1270
+ .ctl-skeleton-table {
1271
+ display: flex;
1272
+ flex-direction: column;
1273
+ overflow: hidden;
1274
+ border: 1px solid var(--ctl-border);
1275
+ border-radius: var(--ctl-radius);
1276
+ }
1277
+
1278
+ .ctl-skeleton-row {
1279
+ display: flex;
1280
+ gap: var(--ctl-space-3);
1281
+ padding: var(--ctl-space-3);
1282
+ border-top: 1px solid var(--ctl-border);
1283
+ }
1284
+
1285
+ .ctl-skeleton-row:first-child {
1286
+ background: var(--ctl-surface);
1287
+ border-top: 0;
1288
+ }
1289
+
1290
+ .ctl-skeleton-cell {
1291
+ flex: 1 1 0;
1292
+ height: 12px;
1293
+ }
1294
+
1295
+ .ctl-spinner {
1296
+ display: inline-block;
1297
+ color: var(--ctl-accent);
1298
+ animation: ctl-spin 900ms linear infinite;
1299
+ }
1300
+
1301
+ .ctl-loading {
1302
+ display: flex;
1303
+ flex-direction: row;
1304
+ gap: var(--ctl-space-2);
1305
+ align-items: center;
1306
+ justify-content: center;
1307
+ padding: var(--ctl-space-6) var(--ctl-space-4);
1308
+ font-size: var(--ctl-text-base);
1309
+ color: var(--ctl-muted);
1310
+ }
1311
+
1312
+ @keyframes ctl-shimmer {
1313
+ from {
1314
+ background-position: 100% 50%;
1315
+ }
1316
+
1317
+ to {
1318
+ background-position: 0 50%;
1319
+ }
1320
+ }
1321
+
1322
+ @keyframes ctl-spin {
1323
+ to {
1324
+ transform: rotate(360deg);
1325
+ }
1326
+ }
1327
+
1328
+ @media (prefers-reduced-motion: reduce) {
1329
+ .ctl-skeleton,
1330
+ .ctl-spinner,
1331
+ .ctl-progress-fill,
1332
+ .ctl-card-clickable,
1333
+ .ctl-row-actions {
1334
+ animation: none;
1335
+ transition: none;
1336
+ }
1337
+ }
1338
+
1339
+ /* It survives being small: the table scrolls inside its own container. */
1340
+ @media (max-width: 480px) {
1341
+ .ctl-page-head {
1342
+ flex-direction: column;
1343
+ }
1344
+
1345
+ .ctl-td,
1346
+ .ctl-th {
1347
+ padding: var(--ctl-space-2);
1348
+ }
1349
+ }