@bigpixelrocket/uiok 0.1.4 → 0.2.1

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 (146) hide show
  1. package/CHANGELOG.md +95 -1
  2. package/README.md +1 -1
  3. package/dist/activity/ActivityBar.d.ts +21 -8
  4. package/dist/activity/ActivityBar.js +15 -5
  5. package/dist/activity/activity.css +53 -6
  6. package/dist/button/Button.d.ts +10 -6
  7. package/dist/button/Button.js +6 -1
  8. package/dist/button/button.css +201 -33
  9. package/dist/charts/Line.logic.d.ts +6 -0
  10. package/dist/charts/Line.logic.js +9 -0
  11. package/dist/charts/LineChart.js +11 -4
  12. package/dist/charts/Pie.logic.d.ts +89 -1
  13. package/dist/charts/Pie.logic.js +272 -2
  14. package/dist/charts/PieChart.d.ts +2 -1
  15. package/dist/charts/PieChart.js +12 -5
  16. package/dist/charts/PieFill.d.ts +15 -0
  17. package/dist/charts/PieFill.js +33 -0
  18. package/dist/charts/ResultChart.d.ts +2 -2
  19. package/dist/charts/ResultChart.js +173 -47
  20. package/dist/charts/ResultChart.logic.d.ts +60 -4
  21. package/dist/charts/ResultChart.logic.js +105 -6
  22. package/dist/charts/Scatter.logic.d.ts +18 -4
  23. package/dist/charts/Scatter.logic.js +98 -22
  24. package/dist/charts/ScatterChart.js +19 -5
  25. package/dist/charts/charts.css +233 -116
  26. package/dist/charts/seriesColour.d.ts +2 -0
  27. package/dist/charts/seriesColour.js +1 -1
  28. package/dist/datetime/DateTimePicker.d.ts +12 -2
  29. package/dist/datetime/DateTimePicker.js +61 -16
  30. package/dist/datetime/DateTimePicker.logic.d.ts +29 -0
  31. package/dist/datetime/DateTimePicker.logic.js +25 -0
  32. package/dist/datetime/datetime.css +89 -49
  33. package/dist/dialog/ConfirmDialog.d.ts +69 -20
  34. package/dist/dialog/ConfirmDialog.js +39 -12
  35. package/dist/dialog/DialogLayer.d.ts +25 -0
  36. package/dist/dialog/DialogLayer.js +24 -0
  37. package/dist/dialog/DialogLegend.d.ts +2 -1
  38. package/dist/dialog/DialogLegend.js +10 -5
  39. package/dist/dialog/DialogLegend.logic.d.ts +15 -3
  40. package/dist/dialog/DialogLegend.logic.js +8 -4
  41. package/dist/dialog/DialogLists.d.ts +157 -0
  42. package/dist/dialog/DialogLists.js +137 -0
  43. package/dist/dialog/ModalDialog.d.ts +20 -15
  44. package/dist/dialog/ModalDialog.js +22 -7
  45. package/dist/dialog/dialog.css +570 -127
  46. package/dist/dialog/index.d.ts +7 -1
  47. package/dist/dialog/index.js +7 -1
  48. package/dist/field/Check.d.ts +15 -0
  49. package/dist/field/Check.js +23 -0
  50. package/dist/field/field.css +812 -0
  51. package/dist/field/index.d.ts +10 -0
  52. package/dist/field/index.js +10 -0
  53. package/dist/field/labelHelp.d.ts +33 -0
  54. package/dist/field/labelHelp.js +22 -0
  55. package/dist/filter/FilterIcon.js +2 -1
  56. package/dist/filter/filter.css +72 -20
  57. package/dist/grid/DataGrid.d.ts +19 -2
  58. package/dist/grid/DataGrid.js +122 -41
  59. package/dist/grid/DataGrid.logic.d.ts +15 -3
  60. package/dist/grid/DataGrid.logic.js +18 -5
  61. package/dist/grid/grid.css +481 -56
  62. package/dist/icon/Spinner.d.ts +16 -0
  63. package/dist/icon/Spinner.js +13 -0
  64. package/dist/icon/index.d.ts +5 -0
  65. package/dist/icon/index.js +5 -0
  66. package/dist/icon/sizes.d.ts +19 -0
  67. package/dist/icon/sizes.js +19 -0
  68. package/dist/index.d.ts +2 -0
  69. package/dist/index.js +2 -0
  70. package/dist/keychord/KeyChord.d.ts +12 -1
  71. package/dist/keychord/KeyChord.js +2 -2
  72. package/dist/keychord/index.d.ts +1 -1
  73. package/dist/keychord/keychord.css +87 -9
  74. package/dist/labels/dialog.d.ts +12 -1
  75. package/dist/labels/dialog.js +3 -1
  76. package/dist/labels/selectAll.d.ts +4 -4
  77. package/dist/labels/selectAll.js +1 -1
  78. package/dist/legend/KeyLegendStrip.js +1 -1
  79. package/dist/legend/legend.css +82 -57
  80. package/dist/listing/Listing.d.ts +17 -10
  81. package/dist/listing/Listing.js +33 -26
  82. package/dist/listing/listing.css +1665 -237
  83. package/dist/menu/menu.css +227 -67
  84. package/dist/menu/useBellBeat.js +2 -2
  85. package/dist/namecut/NameCut.d.ts +3 -1
  86. package/dist/namecut/NameCut.js +152 -5
  87. package/dist/namecut/NameCut.logic.d.ts +5 -3
  88. package/dist/namecut/NameCut.logic.js +20 -5
  89. package/dist/namecut/namecut.css +27 -7
  90. package/dist/pager/Pager.d.ts +12 -4
  91. package/dist/pager/Pager.js +21 -7
  92. package/dist/pager/pager.css +41 -30
  93. package/dist/palette/Palette.js +2 -1
  94. package/dist/palette/palette.css +121 -60
  95. package/dist/pane/PaneActions.d.ts +56 -14
  96. package/dist/pane/PaneActions.js +64 -16
  97. package/dist/pane/PaneFrame.d.ts +37 -5
  98. package/dist/pane/PaneFrame.js +246 -11
  99. package/dist/pane/index.d.ts +4 -2
  100. package/dist/pane/index.js +4 -2
  101. package/dist/pane/toolWords.d.ts +14 -0
  102. package/dist/pane/toolWords.js +26 -0
  103. package/dist/pane/useToolbarFit.d.ts +25 -0
  104. package/dist/pane/useToolbarFit.js +95 -0
  105. package/dist/run/RunHeader.d.ts +5 -3
  106. package/dist/run/RunHeader.js +11 -8
  107. package/dist/run/run.css +64 -79
  108. package/dist/segmented/SegmentedChoice.d.ts +18 -2
  109. package/dist/segmented/SegmentedChoice.js +18 -7
  110. package/dist/segmented/segmented.css +62 -22
  111. package/dist/selectall/SelectAllBar.d.ts +4 -3
  112. package/dist/selectall/SelectAllBar.js +4 -3
  113. package/dist/selectall/selectall.css +17 -12
  114. package/dist/shell/shell.css +1073 -0
  115. package/dist/styles.css +620 -22
  116. package/dist/surface/surface.css +154 -0
  117. package/dist/tabs/PageTabs.d.ts +10 -5
  118. package/dist/tabs/PageTabs.js +126 -37
  119. package/dist/tabs/tabs.css +131 -51
  120. package/dist/terminal/Terminal.js +3 -1
  121. package/dist/terminal/Terminal.logic.d.ts +5 -4
  122. package/dist/terminal/Terminal.logic.js +9 -4
  123. package/dist/terminal/TerminalMenu.d.ts +4 -1
  124. package/dist/terminal/TerminalMenu.js +12 -5
  125. package/dist/terminal/ghostty/contrast.logic.d.ts +45 -0
  126. package/dist/terminal/ghostty/contrast.logic.js +130 -0
  127. package/dist/terminal/ghostty/core.d.ts +6 -0
  128. package/dist/terminal/ghostty/renderer.d.ts +9 -2
  129. package/dist/terminal/ghostty/renderer.js +91 -14
  130. package/dist/terminal/ghostty/surface.d.ts +8 -0
  131. package/dist/terminal/ghostty/surface.js +27 -1
  132. package/dist/terminal/terminal.css +87 -61
  133. package/dist/text/text.css +16 -7
  134. package/dist/themes/catalog.js +4 -3
  135. package/dist/themes/themes.generated.css +1307 -264
  136. package/dist/themes/tokens.d.ts +69 -14
  137. package/dist/themes/tokens.js +920 -97
  138. package/dist/tokens.css +239 -0
  139. package/dist/tooltip/Tooltip.d.ts +6 -0
  140. package/dist/tooltip/Tooltip.js +48 -6
  141. package/dist/tooltip/Tooltip.logic.d.ts +89 -12
  142. package/dist/tooltip/Tooltip.logic.js +142 -20
  143. package/dist/tooltip/index.d.ts +1 -1
  144. package/dist/tooltip/index.js +1 -1
  145. package/dist/tooltip/tooltip.css +39 -9
  146. package/package.json +3 -3
@@ -2,65 +2,132 @@
2
2
 
3
3
  Rows of one height on a scrolling well, under a header that stays put,
4
4
  cells cut to their column with an ellipsis, the cursor cell ringed in the
5
- accent. */
5
+ accent.
6
+
7
+ The frame (.data-grid) draws the border, the corners, and the ground and
8
+ clips to them; the well inside it (.data-grid-scroll) scrolls and fades
9
+ the side that hides columns. The fade is a mask, which would erase a
10
+ border on the box it masks, so the frame stays whole at every scroll.
11
+ The frame fills the width it is given, as a desktop table view fills its
12
+ pane: the header band and the rows run on past the last column, which
13
+ leaves the slack as an empty filler. A grid that is a pane's whole body
14
+ drops the frame with one scoped rule of the host's (docs/components/grid.md). */
6
15
  .data-grid {
7
16
  position: relative;
8
- width: max-content;
9
- max-width: 100%;
10
- overflow: auto;
11
- border: 1px solid var(--border);
12
- border-radius: 4px;
17
+ display: flex;
18
+ flex-direction: column;
19
+ width: 100%;
20
+ min-width: 0;
21
+ overflow: hidden;
22
+ border: var(--line) solid var(--border-strong);
23
+ border-radius: var(--radius-md);
13
24
  background: var(--ground);
14
25
  color: var(--text);
15
- font: 12px/22px var(--font-mono);
26
+ /* Text sits on the row's own height, so a line is a row. */
27
+ font: var(--font-size-small)/var(--row-height-dense) var(--font-mono);
16
28
  box-sizing: border-box;
17
29
  }
18
30
 
19
- .data-grid:focus-visible {
20
- outline: 2px solid var(--accent);
21
- outline-offset: -2px;
31
+ .data-grid-scroll {
32
+ position: relative;
33
+ flex: 1 1 auto;
34
+ min-height: 0;
35
+ overflow: auto;
36
+ }
37
+
38
+ /* The well holds the keyboard; its ring is the frame's, drawn inside the
39
+ border so a clipping pane never cuts it and the fade never erases it. */
40
+ .data-grid-scroll:focus-visible {
41
+ outline: none;
42
+ }
43
+
44
+ .data-grid:has(> .data-grid-scroll:focus-visible) {
45
+ outline: var(--focus-ring-width) solid var(--accent);
46
+ outline-offset: var(--focus-offset-inset);
47
+ }
48
+
49
+ /* The sort labels in the sticky header and the links in cut cells sit in a
50
+ box that clips: their rings sit inside. */
51
+ .data-grid-sort:focus-visible,
52
+ .data-grid-link:focus-visible {
53
+ outline-offset: var(--focus-offset-inset);
22
54
  }
23
55
 
24
56
  .data-grid-header {
25
57
  position: sticky;
26
58
  top: 0;
27
- z-index: 1;
59
+ z-index: var(--z-raised);
28
60
  display: grid;
29
61
  width: max-content;
30
62
  min-width: 100%;
31
63
  background: var(--surface-header);
32
- border-bottom: 1px solid var(--border);
64
+ border-bottom: var(--line) solid var(--border);
33
65
  }
34
66
 
35
67
  .data-grid-heading {
36
68
  position: relative;
37
69
  min-width: 0;
38
- padding: 0 8px;
70
+ padding: 0 var(--space-4);
39
71
  overflow: hidden;
40
72
  color: var(--text-dim);
41
- font-weight: 600;
73
+ font-weight: var(--font-weight-strong);
42
74
  text-overflow: ellipsis;
43
75
  white-space: nowrap;
44
76
  }
45
77
 
46
78
  .data-grid-sort {
47
- display: inline-flex;
48
- gap: 4px;
79
+ /* A box of the row's height off the text baseline, so a sort mark never
80
+ adds its descent to the line and the header keeps one height sorted or
81
+ not. As wide as its words, so a click beside them marks the column. */
82
+ display: flex;
83
+ align-items: center;
84
+ gap: var(--space-2);
85
+ width: fit-content;
49
86
  max-width: 100%;
87
+ height: var(--row-height-dense);
50
88
  padding: 0;
51
89
  border: none;
52
90
  background: none;
53
91
  color: inherit;
54
92
  font: inherit;
55
- cursor: pointer;
93
+ cursor: default;
56
94
  }
57
95
 
58
96
  .data-grid-sort:hover:enabled {
59
97
  color: var(--text);
60
98
  }
61
99
 
100
+ /* A right-aligned column keeps its label on the right edge, over the digits
101
+ under it: the sort mark goes before the label instead of after. */
102
+ .data-grid-heading.align-right .data-grid-sort {
103
+ flex-direction: row-reverse;
104
+ margin-inline-start: auto;
105
+ }
106
+
107
+ /* A label longer than its column ends in an ellipsis before the mark. */
108
+ .data-grid-sort-name {
109
+ min-width: 0;
110
+ overflow: hidden;
111
+ text-overflow: ellipsis;
112
+ }
113
+
114
+ /* The sort mark: the chevron the listing's sort draws, and the column's
115
+ place in a sort of several. */
62
116
  .data-grid-arrow {
63
- font-size: 9px;
117
+ display: inline-flex;
118
+ flex: none;
119
+ align-items: center;
120
+ color: var(--text);
121
+ }
122
+
123
+ .data-grid-arrow svg {
124
+ display: block;
125
+ }
126
+
127
+ .data-grid-arrow small {
128
+ font-size: var(--font-size-caption);
129
+ font-variant-numeric: tabular-nums;
130
+ line-height: 1;
64
131
  }
65
132
 
66
133
  .data-grid-resize {
@@ -69,15 +136,53 @@
69
136
  right: 0;
70
137
  width: 6px;
71
138
  height: 100%;
72
- border-right: 1px solid var(--border);
139
+ border-right: var(--line) solid var(--border);
73
140
  cursor: col-resize;
74
141
  touch-action: none;
75
142
  }
76
143
 
144
+ /* The edge under the pointer, and while it is dragged, draws in the accent,
145
+ so a reader sees which column the drag resizes. */
146
+ .data-grid-resize:hover,
147
+ .data-grid-resize:active {
148
+ border-right: var(--line-strong) solid var(--accent);
149
+ }
150
+
151
+ /* The last column ends at the frame, which draws that edge: its own line
152
+ would double it. The last handle keeps its hit area and its accent line
153
+ while it is used. */
154
+ .data-grid-heading:last-child .data-grid-resize:not(:hover, :active) {
155
+ border-right-color: transparent;
156
+ }
157
+
77
158
  .data-grid-body {
78
159
  position: relative;
79
160
  }
80
161
 
162
+ /* A grid with no rows keeps a well of two rows under its header, so it reads
163
+ as an empty grid rather than a header alone. */
164
+ .data-grid-body.empty {
165
+ min-height: calc(2 * var(--row-height-dense));
166
+ }
167
+
168
+ /* What an empty grid says (the `empty` prop): set where the first row
169
+ would be, in the grid's cell type (the grid's monospace at its row
170
+ height, inherited) at a cell's inset, dim, so it reads as a quiet first
171
+ row. It keeps to the grid's visible width while a wide header scrolls
172
+ sideways, and wraps rather than widen the grid. */
173
+ .data-grid-empty {
174
+ position: sticky;
175
+ left: 0;
176
+ display: flex;
177
+ align-items: center;
178
+ box-sizing: border-box;
179
+ min-height: var(--row-height-dense);
180
+ padding: 0 var(--space-4);
181
+ color: var(--text-dim);
182
+ -webkit-user-select: text;
183
+ user-select: text;
184
+ }
185
+
81
186
  .data-grid-row {
82
187
  position: absolute;
83
188
  top: 0;
@@ -85,107 +190,308 @@
85
190
  display: grid;
86
191
  width: max-content;
87
192
  min-width: 100%;
88
- height: 22px;
193
+ height: var(--row-height-dense);
89
194
  }
90
195
 
91
196
  .data-grid-row:nth-child(even) {
92
- background: color-mix(in srgb, var(--text) 3%, transparent);
197
+ background: var(--row-zebra);
93
198
  }
94
199
 
95
200
  .data-grid-cell {
96
201
  min-width: 0;
97
- padding: 0 8px;
202
+ padding: 0 var(--space-4);
98
203
  overflow: hidden;
99
- border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
204
+ border-right: var(--line) solid var(--border);
100
205
  text-overflow: ellipsis;
101
206
  white-space: nowrap;
102
207
  cursor: default;
103
208
  }
104
209
 
210
+ /* A grid selects cells, not text, as a desktop table does: a drag, a
211
+ Shift-click, or a double-click on a row never starts a text selection.
212
+ A value is copied whole from the cursor cell by the page's Copy (⌘C),
213
+ which DataGrid answers with `copyText`. This holds inside a region a
214
+ host opts into selection, so it is said here and not left to the base
215
+ sheet's default. The header is chrome and refuses selection with the
216
+ rows; a field in it keeps its own text. */
217
+ :is(.data-grid-header, .data-grid-header :not(input, textarea), .data-grid-row, .data-grid-row *) {
218
+ -webkit-user-select: none;
219
+ user-select: none;
220
+ }
221
+
222
+ .data-grid-cell:last-child {
223
+ border-right: none;
224
+ }
225
+
105
226
  .data-grid-cell.align-right,
106
227
  .data-grid-heading.align-right {
107
228
  text-align: right;
108
229
  }
109
230
 
110
231
  .data-grid-cell.cursor {
111
- background: var(--cursor-row-bg);
112
- box-shadow: inset 0 0 0 1px var(--accent);
232
+ background: var(--cursor-row);
233
+ box-shadow: inset 0 0 0 var(--line) var(--accent);
113
234
  }
114
235
 
115
236
  .data-grid-action {
116
237
  display: flex;
117
238
  align-items: center;
118
- padding: 0 6px;
239
+ padding: 0 var(--space-3);
119
240
  }
120
241
 
121
- /* A row's controls before its cells: a checkbox and compact icon actions. */
242
+ /* A row's controls before its cells: a checkbox and compact icon actions.
243
+ The checkbox starts --space-3 inside the frame, the inset SelectAllBar
244
+ keeps, so a bar under the grid lines its box up with the rows'. */
122
245
  .data-grid-lead {
123
246
  display: flex;
124
247
  align-items: center;
125
- gap: 2px;
126
- padding: 0 4px;
127
- border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
248
+ gap: var(--space-1);
249
+ padding: 0 var(--space-2) 0 var(--space-3);
250
+ border-right: var(--line) solid var(--border);
128
251
  }
129
252
 
130
253
  .data-grid-lead input[type='checkbox'] {
131
- margin: 0 4px 0 2px;
254
+ margin: 0 var(--space-2) 0 0;
132
255
  }
133
256
 
134
- /* A cell whose value opens something: a linked record, a download. */
257
+ /* A cell whose value leads out of its row (`onOpen`: a foreign key into
258
+ another table, a download) is a link to another record, not an action,
259
+ so it looks like one: the accent's text colour
260
+ over an accent underline that darkens under the pointer, so a mouse user
261
+ sees which columns lead elsewhere. On the cursor cell a small dim arrow
262
+ at the cell's trailing edge says Return or a click follows it. A value
263
+ that opens a document (a download, which a host marks `cell-binary`)
264
+ keeps its quieter underline in the cell's own colour. The pointer stays
265
+ the arrow. */
135
266
  .data-grid-link {
136
267
  max-width: 100%;
137
268
  padding: 0;
138
269
  overflow: hidden;
139
270
  border: none;
140
271
  background: none;
141
- color: var(--accent);
272
+ color: var(--accent-text);
142
273
  font: inherit;
143
274
  text-decoration: underline;
144
- text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
275
+ text-decoration-color: var(--accent-line);
145
276
  text-overflow: ellipsis;
146
277
  white-space: nowrap;
147
- cursor: pointer;
278
+ cursor: default;
148
279
  }
149
280
 
150
281
  .data-grid-link:hover:enabled {
151
- text-decoration-color: var(--accent);
282
+ text-decoration-color: var(--accent-text);
283
+ }
284
+
285
+ /* The cursor cell's arrow is the icon family's (lucide ArrowRight at
286
+ --icon-sm, the size of the grid's other marks), drawn as a mask in the
287
+ on-surface tone, so its weight and shape never follow the cell's font.
288
+ The cell keeps room for it: the arrow, and --space-2 on either side.
289
+ Right to left it is mirrored, read from the dir attribute (minifiers
290
+ rewrite the direction pseudo-class into a list of languages). */
291
+ .data-grid-cell.cursor:has(> .data-grid-link) {
292
+ position: relative;
293
+ padding-inline-end: calc(2 * var(--space-2) + var(--icon-sm));
294
+ }
295
+
296
+ .data-grid-cell.cursor:not(.editing) > .data-grid-link::after {
297
+ position: absolute;
298
+ inset-block: 0;
299
+ inset-inline-end: var(--space-2);
300
+ width: var(--icon-sm);
301
+ height: var(--icon-sm);
302
+ margin-block: auto;
303
+ background: var(--text-on-surface);
304
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E")
305
+ center / contain no-repeat;
306
+ content: '' / '';
307
+ }
308
+
309
+ .data-grid-cell.cursor:not(.editing):where([dir='rtl'] *, [dir='rtl']) > .data-grid-link::after {
310
+ transform: scaleX(-1);
152
311
  }
153
312
 
154
- /* The row under the pointer, a marked row, and a marked column. */
155
- .data-grid.pointer .data-grid-row:hover {
156
- background: var(--hover-wash);
313
+ .data-grid-cell.cell-binary .data-grid-link {
314
+ color: inherit;
315
+ text-decoration: underline;
316
+ text-decoration-color: var(--text-faint);
317
+ text-underline-offset: var(--space-1);
318
+ }
319
+
320
+ .data-grid-cell.cell-binary.cursor > .data-grid-link::after {
321
+ content: none;
322
+ }
323
+
324
+ /* The row under the pointer, a marked row, and a marked column. The hover
325
+ is a wash of the text colour, so it reads in light and dark themes alike
326
+ and apart from a zebra row; a marked row keeps its own tint under the
327
+ pointer. A marked row is a tint with a bar on its leading edge, apart
328
+ from the cursor cell's ring and from the zebra rows; the bar is drawn
329
+ over the lead and the first cell, whatever fills them. */
330
+ .data-grid.pointer .data-grid-row:not(.marked):hover {
331
+ background: var(--row-hover);
332
+ }
333
+
334
+ .data-grid-row.marked {
335
+ background: var(--marked-bg);
157
336
  }
158
337
 
159
- .data-grid-row.marked,
160
- .data-grid-row.marked:hover {
161
- background: color-mix(in srgb, var(--accent) 14%, transparent);
338
+ /* A lead checkbox on a tinted row keeps its edge at 3:1 (.check reads the
339
+ hook). The cursor is a cell, so it never tints the lead. */
340
+ .data-grid.pointer .data-grid-row:hover,
341
+ .data-grid-row.marked {
342
+ --check-edge: var(--control-border-strong);
162
343
  }
163
344
 
345
+ /* A row action drawn with its word (RowIconAction's worded look) rests in
346
+ --text-dim, which holds 4.5:1 on the ground but not on the hover wash or
347
+ the marked tint: there it takes the on-surface words, floored on both.
348
+ The action the pointer is over, and a destructive one with the focus,
349
+ keep their own colours. */
350
+ .data-grid.pointer
351
+ .data-grid-row:hover
352
+ .pane-icon-act.worded:where(:not(.lit, :hover, .danger:focus-visible)),
353
+ .data-grid-row.marked .pane-icon-act.worded:where(:not(.lit, :hover, .danger:focus-visible)) {
354
+ color: var(--text-on-surface);
355
+ }
356
+
357
+ /* An action under the pointer, held, or holding its pop-up open on a
358
+ hovered or marked row keeps the row's fill under its words (floored
359
+ there), not the wash over it; the frosted ring and the pressed hairline
360
+ still answer. The list is every control the base sheet's recipes wash,
361
+ as in listing.css; a test holds it to the recipes'. */
362
+ :is(.data-grid.pointer .data-grid-row:hover, .data-grid-row.marked)
363
+ :is(
364
+ .pager-step,
365
+ .legend-slot,
366
+ .keylegend-verbs button,
367
+ .pane-act,
368
+ .pane-icon-act,
369
+ .path-star,
370
+ .page-tab,
371
+ .segmented-choice-option,
372
+ .date-picker-day,
373
+ .crumb-label,
374
+ .pane-sort.sortable,
375
+ .pane-strip-link,
376
+ .data-grid-sort,
377
+ .palette-level,
378
+ .disclosure,
379
+ .settings-sidebar-page,
380
+ .settings-sidebar-subsection,
381
+ .quiet-control,
382
+ .quiet-track-item,
383
+ .toggle-chip
384
+ ):is(
385
+ :hover,
386
+ :active,
387
+ [aria-expanded='true']:where([aria-haspopup]:not([aria-haspopup='false']), .crumb-label)
388
+ ):enabled {
389
+ background: transparent;
390
+ }
391
+
392
+ .data-grid-row.marked::before {
393
+ position: absolute;
394
+ inset-block: 0;
395
+ inset-inline-start: 0;
396
+ z-index: var(--z-raised);
397
+ width: var(--line-strong);
398
+ background: var(--marked-bar);
399
+ content: '';
400
+ }
401
+
402
+ /* A cell whose state replaces its row's paints its tint over the bare
403
+ ground, not over the row's tint, so the text sits on the one ground its
404
+ colour is floored on. */
405
+ .data-grid-row.marked .data-grid-cell.cursor {
406
+ background: linear-gradient(var(--marked-cursor-bg), var(--marked-cursor-bg)) var(--ground);
407
+ }
408
+
409
+ /* A marked column lights its cells and underlines its heading, whose words
410
+ go to full text on the tint; on a marked row the row's tint alone, so two
411
+ tints never stack under the text. */
164
412
  .data-grid-cell.marked,
165
413
  .data-grid-heading.marked {
166
- background: color-mix(in srgb, var(--accent) 10%, transparent);
414
+ background: var(--accent-wash);
415
+ }
416
+
417
+ .data-grid-heading.marked {
418
+ box-shadow: inset 0 calc(-1 * var(--line-strong)) 0 var(--accent);
419
+ color: var(--text);
167
420
  }
168
421
 
169
- /* A header that drags to a new place, and where it lands. */
170
- .data-grid-heading.draggable {
171
- cursor: grab;
422
+ .data-grid-row.marked .data-grid-cell.marked:not(.cursor, .cell-edited) {
423
+ background: none;
172
424
  }
173
425
 
426
+ /* A header that drags to a new place, and where it lands. The pointer
427
+ stays the arrow while it drags, as a desktop table's column does; the
428
+ heading in the hand fades and lifts, and the accent bar marks where it
429
+ lands. */
174
430
  .data-grid-heading.dragging {
175
- opacity: 0.5;
431
+ background: var(--accent-wash);
432
+ opacity: var(--dragging-opacity);
176
433
  }
177
434
 
178
435
  .data-grid-heading.drop-before {
179
- box-shadow: inset 2px 0 0 var(--accent);
436
+ box-shadow: inset var(--line-strong) 0 0 var(--accent);
180
437
  }
181
438
 
182
439
  .data-grid-heading.drop-after {
183
- box-shadow: inset -2px 0 0 var(--accent);
440
+ box-shadow: inset calc(-1 * var(--line-strong)) 0 0 var(--accent);
184
441
  }
185
442
 
186
- .data-grid-arrow small {
187
- margin-left: 1px;
188
- font-size: 9px;
443
+ /* A grid where the keys are not (a window that is not in front, which the
444
+ host marks with `data-window-inactive` on the root, or a pane beside the
445
+ one that holds the keys) draws its marks quiet, as a listing's quiet rows
446
+ do: a marked row and a marked column take the neutral fill (--fill)
447
+ with the text on it, the marked bar and the column's underline the
448
+ neutral edge tone, and a checked box in a row turns grey, its mark cut
449
+ out in the fill. The cursor cell is another thing: no
450
+ fill of its own, a hairline frame in the neutral edge tone, so it shows
451
+ on a plain row and inside a quiet mark alike. */
452
+ :where(
453
+ :root[data-window-inactive] .data-grid,
454
+ .listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
455
+ )
456
+ :is(.data-grid-row.marked, .data-grid-cell.marked, .data-grid-heading.marked) {
457
+ background: var(--fill);
458
+ }
459
+
460
+ :where(
461
+ :root[data-window-inactive] .data-grid,
462
+ .listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
463
+ )
464
+ .data-grid-row.marked::before {
465
+ background: var(--control-border-strong);
466
+ }
467
+
468
+ :where(
469
+ :root[data-window-inactive] .data-grid,
470
+ .listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
471
+ )
472
+ .data-grid-heading.marked {
473
+ box-shadow: inset 0 calc(-1 * var(--line-strong)) 0 var(--control-border-strong);
474
+ }
475
+
476
+ :where(
477
+ :root[data-window-inactive] .data-grid,
478
+ .listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
479
+ )
480
+ .data-grid-row
481
+ .data-grid-cell.cursor:not(.cell-edited) {
482
+ background: transparent;
483
+ box-shadow: inset 0 0 0 var(--line) var(--control-border-strong);
484
+ }
485
+
486
+ :where(
487
+ :root[data-window-inactive] .data-grid,
488
+ .listing-root:has(.pane.active) .pane:not(.active, .active .pane) .data-grid
489
+ )
490
+ .data-grid-row
491
+ :is(.check, input[type='checkbox']) {
492
+ --check-on: var(--control-border-strong);
493
+ --check-on-pressed: var(--control-border-strong);
494
+ --check-mark: var(--fill);
189
495
  }
190
496
 
191
497
  /* Inline edit: the editor drawn over its cell in a layer of its own, so the
@@ -194,13 +500,132 @@
194
500
  className holds cell-edited). */
195
501
  .data-grid-editor {
196
502
  position: fixed;
197
- z-index: calc(var(--z-dialog) + 1);
503
+ z-index: var(--z-dialog-popover);
504
+ display: flex;
505
+ align-items: stretch;
506
+ gap: var(--space-1);
198
507
  box-sizing: border-box;
199
- font: 12px/1.4 var(--font-ui);
508
+ font: var(--font-size-small)/var(--line-height-prose) var(--font-ui);
200
509
  white-space: normal;
201
510
  cursor: auto;
202
511
  }
203
512
 
204
- .data-grid-cell.cell-edited {
205
- background: color-mix(in srgb, var(--warning) 16%, transparent);
513
+ /* A layer that holds more than a bare field (a field with Save and Cancel)
514
+ stands on a panel of its own, so the cell's text and the column lines
515
+ never show through a quiet button or between the buttons. The panel's
516
+ padding and edge sit outside the layer's measured box (content-box, and a
517
+ margin as wide pulling it back), so its field still lies on the cell. */
518
+ .data-grid-editor:has(> :not(input, select, textarea)) {
519
+ box-sizing: content-box;
520
+ margin: calc(-1 * (var(--space-1) + var(--line)));
521
+ padding: var(--space-1);
522
+ border: var(--line) solid var(--border-strong);
523
+ border-radius: var(--radius-sm);
524
+ background: var(--surface);
525
+ box-shadow:
526
+ inset 0 var(--line) 0 var(--glass-edge),
527
+ var(--shadow-popover);
528
+ }
529
+
530
+ /* With buttons beside it, the field keeps at least its cell's width
531
+ (--data-grid-editor-cell, set on the layer), and the panel grows by the
532
+ buttons, rather than the buttons squeezing the field to a few characters.
533
+ It outweighs the field's own rule below, which holds a bare field to its
534
+ cell. */
535
+ .data-grid-editor:has(> :not(input, select, textarea))
536
+ > :is(
537
+ input:not([type='checkbox'], [type='radio']),
538
+ select,
539
+ textarea,
540
+ :has(:is(input, select, textarea))
541
+ ) {
542
+ min-width: var(--data-grid-editor-cell, 0);
543
+ }
544
+
545
+ /* A wrapper the caller puts round its field and buttons fills the layer,
546
+ so its field can take what the buttons leave. */
547
+ .data-grid-editor > :has(:is(input, select, textarea)) {
548
+ flex: 1 1 auto;
549
+ min-width: 0;
550
+ }
551
+
552
+ /* The caller's field takes the cell's place: as wide as the cell (the layer
553
+ is, unless buttons beside it ask for more), as tall as the row plus the
554
+ frame, its text in the cell's face on the cell's baseline and at the
555
+ cell's own inset (the layer starts a hairline before the cell, so its
556
+ edge lies on the column line, and the field's border fills that
557
+ hairline: the start padding is the cell's), a field edge in the accent,
558
+ whether it is the layer's own child or inside a wrapper. A direct
559
+ child's own width never widens the layer. */
560
+ .data-grid-editor :is(input:not([type='checkbox'], [type='radio']), select, textarea) {
561
+ flex: 1 1 0;
562
+ box-sizing: border-box;
563
+ min-width: 0;
564
+ height: calc(var(--row-height-dense) + 2 * var(--line));
565
+ margin: 0;
566
+ padding: 0;
567
+ padding-inline: var(--space-4) calc(var(--space-4) - var(--line));
568
+ border: var(--line) solid var(--accent);
569
+ border-radius: var(--radius-xs);
570
+ background: var(--ground);
571
+ color: var(--text);
572
+ font: var(--font-size-small)/var(--row-height-dense) var(--font-mono);
573
+ }
574
+
575
+ .data-grid-editor > :is(input, select, textarea) {
576
+ width: 0;
577
+ }
578
+
579
+ .data-grid-editor textarea {
580
+ height: auto;
581
+ min-height: calc(var(--row-height-dense) + 2 * var(--line));
582
+ resize: none;
583
+ }
584
+
585
+ /* Focus keeps the field's edge on its border: no ring over the row above. */
586
+ .data-grid-editor
587
+ :is(input:not([type='checkbox'], [type='radio']), select, textarea):focus-visible {
588
+ outline: var(--line) solid var(--accent);
589
+ outline-offset: var(--focus-offset-flush);
590
+ }
591
+
592
+ /* A value edited but not saved: the warning tint over the bare ground,
593
+ whatever row it sits in, and a warning corner, the spreadsheet's mark,
594
+ which holds where the tint alone is faint. The corner is drawn in
595
+ --warning-text, which keeps 3:1 on the strong wash under it. */
596
+ .data-grid-cell.cell-edited,
597
+ .data-grid-row.marked .data-grid-cell.cell-edited {
598
+ background:
599
+ linear-gradient(225deg, var(--warning-text) var(--space-3), transparent var(--space-3)),
600
+ linear-gradient(var(--warning-wash-strong), var(--warning-wash-strong)) var(--ground);
601
+ }
602
+
603
+ /* Values that are not text: a missing value (SQL NULL) set apart from the
604
+ word, and bytes shown by their kind and size. The classes are hooks a
605
+ caller sets through a cell's className. On a row or cell in a state the
606
+ quiet word takes the text role floored on state grounds; the italic keeps
607
+ it apart from a value. */
608
+ .data-grid-cell.cell-null {
609
+ color: var(--row-meta-text);
610
+ font-style: italic;
611
+ }
612
+
613
+ .data-grid.pointer .data-grid-row:hover .data-grid-cell.cell-null,
614
+ .data-grid-row.marked .data-grid-cell.cell-null,
615
+ .data-grid-cell.cell-null:is(.cursor, .marked, .cell-edited) {
616
+ color: var(--text-on-surface);
617
+ }
618
+
619
+ .data-grid-cell.cell-binary {
620
+ color: var(--cell-binary-text);
621
+ }
622
+
623
+ /* The cell under an open editor drops the cursor's fill, ring, and words:
624
+ the editor marks the place, and a panel wider than its cell that moves
625
+ inside the frame leaves the rest of the cell plain, as its row draws it.
626
+ Last, at the weight of every state rule above, so none paints over it. */
627
+ .data-grid .data-grid-row .data-grid-cell.cursor.editing {
628
+ background: none;
629
+ box-shadow: none;
630
+ color: transparent;
206
631
  }
@@ -0,0 +1,16 @@
1
+ import type { ReactElement } from 'react';
2
+ /** Props for {@link Spinner}. */
3
+ export interface SpinnerProps {
4
+ /** Its size, one of the icon sizes; `ICON_SM` unless given. */
5
+ readonly size?: number;
6
+ /** Classes the host adds for its place and colour. */
7
+ readonly className?: string;
8
+ }
9
+ /**
10
+ * The library's one spinner: a turning ring for work under way, drawn in the
11
+ * current text colour. It turns once per `--duration-spin` and stands still
12
+ * under reduced motion, where the words beside it say the work is running.
13
+ * Decorative: it is hidden from assistive technology, so the host says what
14
+ * is busy in words.
15
+ */
16
+ export declare function Spinner({ size, className }: SpinnerProps): ReactElement;