@bigpixelrocket/uiok 0.2.1 → 0.2.3
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.
- package/CHANGELOG.md +51 -1
- package/dist/button/TextLink.d.ts +27 -0
- package/dist/button/TextLink.js +15 -0
- package/dist/button/button.css +48 -0
- package/dist/button/index.d.ts +2 -1
- package/dist/button/index.js +2 -1
- package/dist/charts/Line.logic.d.ts +15 -1
- package/dist/charts/Line.logic.js +37 -4
- package/dist/charts/LineChart.d.ts +42 -2
- package/dist/charts/LineChart.js +41 -9
- package/dist/charts/Scatter.logic.js +7 -2
- package/dist/charts/charts.css +35 -5
- package/dist/charts/index.d.ts +1 -1
- package/dist/dialog/ConfirmDialog.d.ts +7 -1
- package/dist/dialog/ConfirmDialog.js +9 -4
- package/dist/dialog/DialogLists.d.ts +8 -1
- package/dist/dialog/DialogLists.js +3 -2
- package/dist/field/field.css +110 -2
- package/dist/filter/filter.css +16 -0
- package/dist/grid/DataGrid.d.ts +10 -2
- package/dist/grid/DataGrid.js +47 -13
- package/dist/grid/DataGrid.logic.d.ts +16 -0
- package/dist/grid/DataGrid.logic.js +28 -0
- package/dist/grid/grid.css +128 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/labels/UiokLabels.d.ts +3 -0
- package/dist/labels/UiokLabels.js +3 -1
- package/dist/labels/index.d.ts +1 -0
- package/dist/labels/index.js +1 -0
- package/dist/labels/keys.js +2 -0
- package/dist/labels/paneTabs.d.ts +27 -0
- package/dist/labels/paneTabs.js +10 -0
- package/dist/labels/selectAll.d.ts +4 -1
- package/dist/labels/selectAll.js +1 -1
- package/dist/legend/KeyLegendStrip.d.ts +9 -1
- package/dist/legend/KeyLegendStrip.js +119 -5
- package/dist/legend/legend.css +52 -0
- package/dist/listing/Listing.d.ts +23 -5
- package/dist/listing/Listing.js +11 -8
- package/dist/listing/listing.css +106 -3
- package/dist/pane/PaneActions.d.ts +3 -1
- package/dist/pane/PaneActions.js +6 -5
- package/dist/pane/PaneTabs.d.ts +92 -0
- package/dist/pane/PaneTabs.js +326 -0
- package/dist/pane/PaneTabs.logic.d.ts +97 -0
- package/dist/pane/PaneTabs.logic.js +158 -0
- package/dist/pane/index.d.ts +5 -1
- package/dist/pane/index.js +5 -1
- package/dist/pane/panetabs.css +408 -0
- package/dist/pane/useTabDrag.d.ts +49 -0
- package/dist/pane/useTabDrag.js +306 -0
- package/dist/segmented/SegmentedChoice.d.ts +8 -1
- package/dist/segmented/SegmentedChoice.js +7 -4
- package/dist/styles.css +8 -0
- package/dist/surface/GroupSwatch.d.ts +22 -0
- package/dist/surface/GroupSwatch.js +15 -0
- package/dist/surface/Tag.d.ts +26 -0
- package/dist/surface/Tag.js +12 -0
- package/dist/surface/index.d.ts +7 -0
- package/dist/surface/index.js +7 -0
- package/dist/surface/surface.css +116 -1
- package/dist/themes/tokens.js +13 -1
- package/package.json +1 -1
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/* ---- Pane tabs ---------------------------------------------------------------
|
|
2
|
+
The tabs a pane hangs from (PaneTabs): the tab row over the pane's frame,
|
|
3
|
+
the frame hanging from the tab in front, the tabs and their states (in
|
|
4
|
+
front, following, dirty, pinned, picked, in the hand, a danger tone), the
|
|
5
|
+
pin rule, New Tab, the strip's empty end, the folded tabs' count and its
|
|
6
|
+
menu; then a pane's tone. Scoped by :where(.listing-root) as the listing
|
|
7
|
+
look is, so an app adjusts a piece with one scoped selector. */
|
|
8
|
+
|
|
9
|
+
.listing-root {
|
|
10
|
+
/* The tab row's height: the path bar's, so a strip and a bar share a line. */
|
|
11
|
+
--pane-tab-height: var(--bar-height);
|
|
12
|
+
/* A tab behind the one in front. */
|
|
13
|
+
--pane-tab-back: var(--surface-recessed);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* A pane with tabs is its tab row and the frame that hangs from the tab in
|
|
17
|
+
front. The row paints nothing, so the ground shows beside and behind the
|
|
18
|
+
tabs; the content sits inside the frame's hairline under the row. */
|
|
19
|
+
:where(.listing-root) .pane:has(> .pane-header) {
|
|
20
|
+
padding: 0 1px 1px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:where(.listing-root) .pane:has(> .pane-header)::before {
|
|
24
|
+
/* Up under the tab's foot by the hairline, so the tab's surface interrupts
|
|
25
|
+
the frame's top edge and its sides run into the frame's. */
|
|
26
|
+
inset: calc(var(--pane-tab-height) - 1px) 0 0;
|
|
27
|
+
border-radius: 0 var(--radius-md) var(--radius-md);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* The row the tabs stand in. It runs out over the frame's hairline so the
|
|
31
|
+
first tab's near edge meets the frame's, and stops short of the frame's
|
|
32
|
+
rounded far corner. */
|
|
33
|
+
:where(.listing-root) .pane-header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: flex-end;
|
|
36
|
+
gap: var(--space-1);
|
|
37
|
+
height: var(--pane-tab-height);
|
|
38
|
+
flex: 0 0 var(--pane-tab-height);
|
|
39
|
+
min-width: 0;
|
|
40
|
+
margin: 0 -1px;
|
|
41
|
+
padding-right: var(--space-6);
|
|
42
|
+
font: var(--font-size-small) / var(--line-height-compact) var(--font-mono);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* The strip never wraps and never scrolls: its tabs shrink to their floors,
|
|
46
|
+
then fold into the count. */
|
|
47
|
+
:where(.listing-root) .pane-tabs {
|
|
48
|
+
flex: 0 1 auto;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: flex-end;
|
|
51
|
+
gap: var(--space-1);
|
|
52
|
+
min-width: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* A tab wears its place's name. The one in front joins the pane's frame;
|
|
56
|
+
the others stand behind it on the ground, shorter and fainter. A tab takes
|
|
57
|
+
no focus: a press shows it, and the host's verbs are the keyboard's way
|
|
58
|
+
in. It shrinks no narrower than its label's floor (--pane-tab-floor, in
|
|
59
|
+
characters, which PaneTabs sets) past its insets, its border, and the
|
|
60
|
+
room it keeps for its close control. */
|
|
61
|
+
:where(.listing-root) .pane-tab {
|
|
62
|
+
position: relative;
|
|
63
|
+
flex: 0 1 auto;
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: var(--space-2);
|
|
67
|
+
box-sizing: border-box;
|
|
68
|
+
min-width: calc(
|
|
69
|
+
var(--pane-tab-floor, 0ch) + var(--space-4) + var(--space-2) + var(--space-2) + var(--icon-lg) +
|
|
70
|
+
2 * var(--line)
|
|
71
|
+
);
|
|
72
|
+
max-width: calc(
|
|
73
|
+
32ch + var(--space-4) + var(--space-2) + var(--space-2) + var(--icon-lg) + 2 * var(--line)
|
|
74
|
+
);
|
|
75
|
+
/* Shorter than the tab in front, and clear of the frame's top hairline. */
|
|
76
|
+
height: calc(var(--pane-tab-height) - var(--space-2));
|
|
77
|
+
margin-bottom: 1px;
|
|
78
|
+
/* The close control sits in room every tab keeps for it. */
|
|
79
|
+
padding: 0 var(--space-2) 0 var(--space-4);
|
|
80
|
+
border: var(--line) solid var(--border);
|
|
81
|
+
border-bottom: none;
|
|
82
|
+
border-radius: var(--radius-md) var(--radius-md) 0 0;
|
|
83
|
+
background: var(--pane-tab-back);
|
|
84
|
+
color: var(--text-dim);
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
cursor: default;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* A mark ahead of the name takes its own room on top of the floor. */
|
|
90
|
+
:where(.listing-root) .pane-tab:has(> .pane-tab-mark) {
|
|
91
|
+
min-width: calc(
|
|
92
|
+
var(--pane-tab-floor, 0ch) + var(--space-4) + var(--space-2) + var(--space-2) + var(--icon-lg) +
|
|
93
|
+
2 * var(--line) + var(--icon-md) + var(--space-2)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* A tab with no close control, pin, or mark of its own has nothing to keep room for. */
|
|
98
|
+
:where(.listing-root) .pane-tab:not(:has(> :is(.pane-tab-close, .pane-tab-pin, .pane-tab-dirty))) {
|
|
99
|
+
padding-right: var(--space-4);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:where(.listing-root) .pane-tab:hover {
|
|
103
|
+
border-color: var(--border-strong);
|
|
104
|
+
background: linear-gradient(var(--hover-wash), var(--hover-wash)) var(--surface);
|
|
105
|
+
color: var(--text);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* A tab behind, held down: it sinks before it comes to the front. */
|
|
109
|
+
:where(.listing-root) .pane-tab:not(.active, .picked):active {
|
|
110
|
+
background: linear-gradient(var(--pressed-wash), var(--pressed-wash)) var(--surface);
|
|
111
|
+
box-shadow: var(--press-frost);
|
|
112
|
+
color: var(--text);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* The tab in front: full height, open at the foot where its surface
|
|
116
|
+
interrupts the frame's top edge, and never the one that gives up its name
|
|
117
|
+
to a crowded strip. */
|
|
118
|
+
:where(.listing-root) .pane-tab.active {
|
|
119
|
+
flex-shrink: 0;
|
|
120
|
+
height: var(--pane-tab-height);
|
|
121
|
+
margin-bottom: 0;
|
|
122
|
+
border-color: var(--border-strong);
|
|
123
|
+
background: var(--surface);
|
|
124
|
+
box-shadow: none;
|
|
125
|
+
color: var(--text);
|
|
126
|
+
font-weight: var(--font-weight-strong);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* The active pane wears the accent on its frame and on the tab in front;
|
|
130
|
+
in a window that is not in front both go to the strong hairline. */
|
|
131
|
+
:where(.listing-root) .pane.active .pane-tab.active {
|
|
132
|
+
border-color: var(--accent);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:where(:root[data-window-inactive] .listing-root) .pane.active .pane-tab.active,
|
|
136
|
+
:where(:root[data-window-inactive] .listing-root) .pane.active:has(> .pane-header)::before {
|
|
137
|
+
border-color: var(--border-strong);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* A tab picked beside the one in front, to close or move with it, wears
|
|
141
|
+
the tint and edge a marked row does, so it never reads as the tab in
|
|
142
|
+
front, which keeps its outline. Hovered, it keeps the mark. */
|
|
143
|
+
:where(.listing-root) .pane-tab.picked,
|
|
144
|
+
:where(.listing-root) .pane-tab.picked:hover {
|
|
145
|
+
border-color: var(--marked-bar);
|
|
146
|
+
background: linear-gradient(var(--marked-bg), var(--marked-bg)) var(--surface);
|
|
147
|
+
color: var(--text);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* A tab in the hand rides over its neighbours and over a menu's level. */
|
|
151
|
+
:where(.listing-root) .pane-tab.dragging {
|
|
152
|
+
z-index: var(--z-drag);
|
|
153
|
+
box-shadow: var(--shadow-popover);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* What the tab is, ahead of its name: a group's swatch or a kind's glyph. */
|
|
157
|
+
:where(.listing-root) .pane-tab-mark {
|
|
158
|
+
flex: none;
|
|
159
|
+
display: inline-grid;
|
|
160
|
+
place-items: center;
|
|
161
|
+
width: var(--icon-md);
|
|
162
|
+
height: var(--icon-md);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:where(.listing-root) .pane-tab-label {
|
|
166
|
+
display: flex;
|
|
167
|
+
min-width: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:where(.listing-root) .pane-tab-label > * {
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
text-overflow: ellipsis;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* The name gives way last: it is what the eye looks for. */
|
|
176
|
+
:where(.listing-root) .pane-tab-name {
|
|
177
|
+
flex: 0 1 auto;
|
|
178
|
+
min-width: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* What stands above the name, shown only to tell two tabs of one name
|
|
182
|
+
apart. It gives way to an ellipsis before the name loses a character. */
|
|
183
|
+
:where(.listing-root) .pane-tab-context {
|
|
184
|
+
flex: 0 1000000 auto;
|
|
185
|
+
color: var(--text-dim);
|
|
186
|
+
font-weight: var(--font-weight-regular);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:where(.listing-root) .pane-tab-slash {
|
|
190
|
+
flex: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* A following tab shows the place opened last, and the next place opened
|
|
194
|
+
takes it over. Its name is italic, as editors set a preview tab's, until
|
|
195
|
+
something keeps it (docs/tokens.md, italic). */
|
|
196
|
+
:where(.listing-root) .pane-tab.following .pane-tab-name {
|
|
197
|
+
font-style: italic;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* A tab's close control: at rest on the tab in front, under the pointer on
|
|
201
|
+
the others, so a tab never changes width. It joins the quiet control's
|
|
202
|
+
hover and press by class (`quiet-control`). */
|
|
203
|
+
:where(.listing-root) .pane-tab-close {
|
|
204
|
+
flex: none;
|
|
205
|
+
display: inline-grid;
|
|
206
|
+
place-items: center;
|
|
207
|
+
width: var(--icon-lg);
|
|
208
|
+
height: var(--icon-lg);
|
|
209
|
+
padding: 0;
|
|
210
|
+
border: none;
|
|
211
|
+
border-radius: var(--radius-sm);
|
|
212
|
+
cursor: default;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:where(.listing-root :is(.pane-tab-close, .pane-tab-new, .pane-tabs-folded)) {
|
|
216
|
+
background: transparent;
|
|
217
|
+
color: var(--text-dim);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:where(.listing-root) .pane-tab:not(.active, :hover) .pane-tab-close {
|
|
221
|
+
visibility: hidden;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* A dirty tab holds changes not saved. The warning state mark stands where
|
|
225
|
+
the close control does and gives that place back to it under the
|
|
226
|
+
pointer, so the tab keeps its width. A pinned tab has no control to give
|
|
227
|
+
it to, so its mark stays. */
|
|
228
|
+
:where(.listing-root) .pane-tab-dirty {
|
|
229
|
+
flex: none;
|
|
230
|
+
display: inline-grid;
|
|
231
|
+
place-items: center;
|
|
232
|
+
width: var(--icon-lg);
|
|
233
|
+
height: var(--icon-lg);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
:where(.listing-root) .pane-tab.dirty:not(:hover) .pane-tab-close,
|
|
237
|
+
:where(.listing-root) .pane-tab.dirty:has(> .pane-tab-close):hover .pane-tab-dirty {
|
|
238
|
+
display: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* A pinned tab stands before the pin rule, keeps its width however crowded
|
|
242
|
+
the strip, and carries a pin where a tab's close control is. */
|
|
243
|
+
:where(.listing-root) .pane-tab.pinned {
|
|
244
|
+
flex: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
:where(.listing-root) .pane-tab-pin {
|
|
248
|
+
flex: none;
|
|
249
|
+
display: inline-grid;
|
|
250
|
+
place-items: center;
|
|
251
|
+
width: var(--icon-lg);
|
|
252
|
+
height: var(--icon-lg);
|
|
253
|
+
color: var(--text-dim);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
:where(.listing-root) .pane-tab.pinned.active .pane-tab-pin > svg {
|
|
257
|
+
color: var(--accent);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* The hairline between the pinned tabs and the others. */
|
|
261
|
+
:where(.listing-root) .pane-pin-rule {
|
|
262
|
+
flex: none;
|
|
263
|
+
align-self: center;
|
|
264
|
+
width: var(--line);
|
|
265
|
+
height: var(--icon-md);
|
|
266
|
+
margin: 0 var(--space-1) var(--space-1);
|
|
267
|
+
background: var(--border-strong);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Centred on the row's height, so its hover wash stands clear of the
|
|
271
|
+
frame's line below it. */
|
|
272
|
+
:where(.listing-root) .pane-tab-new {
|
|
273
|
+
flex: none;
|
|
274
|
+
display: inline-grid;
|
|
275
|
+
place-items: center;
|
|
276
|
+
width: var(--control-height-xs);
|
|
277
|
+
height: var(--control-height-xs);
|
|
278
|
+
margin: 0 0 var(--space-1) var(--space-1);
|
|
279
|
+
padding: 0;
|
|
280
|
+
border: none;
|
|
281
|
+
border-radius: var(--radius-sm);
|
|
282
|
+
cursor: default;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
:where(.listing-root) :is(.pane-tab-close, .pane-tab-new, .pane-tabs-folded):focus-visible {
|
|
286
|
+
outline: var(--focus-ring-width) solid var(--accent);
|
|
287
|
+
outline-offset: var(--focus-offset-inset);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* The strip's empty end: a double-click there opens a new tab. */
|
|
291
|
+
:where(.listing-root) .pane-tabs-rest {
|
|
292
|
+
flex: 1 1 0;
|
|
293
|
+
align-self: stretch;
|
|
294
|
+
min-width: 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* The folded tabs' count, after New Tab: the warning mark while a folded
|
|
298
|
+
tab is dirty, "+N" in tabular figures, and a chevron. Its hover, press,
|
|
299
|
+
and open looks are the quiet control's. */
|
|
300
|
+
:where(.listing-root) .pane-tabs-folded {
|
|
301
|
+
flex: none;
|
|
302
|
+
display: inline-flex;
|
|
303
|
+
align-items: center;
|
|
304
|
+
gap: var(--space-1);
|
|
305
|
+
box-sizing: border-box;
|
|
306
|
+
height: var(--control-height-xs);
|
|
307
|
+
margin: 0 0 var(--space-1);
|
|
308
|
+
padding: 0 var(--space-2);
|
|
309
|
+
border: none;
|
|
310
|
+
border-radius: var(--radius-sm);
|
|
311
|
+
font: inherit;
|
|
312
|
+
cursor: default;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
:where(.listing-root) .pane-tabs-folded > .pane-tab-dirty {
|
|
316
|
+
width: auto;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
:where(.listing-root) .pane-tabs-folded-count {
|
|
320
|
+
font-variant-numeric: tabular-nums;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* What the host puts at the strip's end (an update pill), on the controls' line. */
|
|
324
|
+
:where(.listing-root) .pane-tabs-trailing {
|
|
325
|
+
flex: none;
|
|
326
|
+
display: inline-flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
align-self: center;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* The folded tabs' menu: the menu look, placed under the count by
|
|
332
|
+
PaneTabs (fixed, so the pane's frame does not clip it), as wide as its
|
|
333
|
+
longest row. */
|
|
334
|
+
.folder-menu.pane-tabs-folded-menu {
|
|
335
|
+
position: fixed;
|
|
336
|
+
top: 0;
|
|
337
|
+
left: 0;
|
|
338
|
+
width: max-content;
|
|
339
|
+
min-width: 24ch;
|
|
340
|
+
max-width: 60ch;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.pane-tabs-folded-option {
|
|
344
|
+
grid-template-columns: var(--icon-column) minmax(0, 1fr) auto;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.pane-tabs-folded-mark {
|
|
348
|
+
display: inline-grid;
|
|
349
|
+
place-items: center start;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.pane-tabs-folded-label {
|
|
353
|
+
display: flex;
|
|
354
|
+
min-width: 0;
|
|
355
|
+
white-space: nowrap;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.pane-tabs-folded-label > * {
|
|
359
|
+
overflow: hidden;
|
|
360
|
+
text-overflow: ellipsis;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.pane-tabs-folded-label > .pane-tab-context {
|
|
364
|
+
flex: 0 1000000 auto;
|
|
365
|
+
color: var(--text-dim);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.pane-tabs-folded-label > .pane-tab-slash {
|
|
369
|
+
flex: none;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.folder-menu-option.cursor .pane-tabs-folded-label > .pane-tab-context {
|
|
373
|
+
color: var(--text-on-surface);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.pane-tabs-folded-marks {
|
|
377
|
+
display: inline-flex;
|
|
378
|
+
align-items: center;
|
|
379
|
+
gap: var(--space-3);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.pane-tabs-folded-marks:not(:empty) {
|
|
383
|
+
margin-left: var(--space-5);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* ---- A pane's tone ----
|
|
387
|
+
`data-tone="danger"` on a .pane draws its frame, and its tabs' outlines,
|
|
388
|
+
in the danger colour, whether or not the pane holds the keys and whether
|
|
389
|
+
or not the window is in front: the tone says where the pane is, not who
|
|
390
|
+
has the keys. A danger tab keeps its edge when it is picked or hovered. */
|
|
391
|
+
:where(.listing-root) .pane[data-tone='danger']::before,
|
|
392
|
+
:where(.listing-root) .pane.active[data-tone='danger']::before,
|
|
393
|
+
:where(:root[data-window-inactive] .listing-root)
|
|
394
|
+
.pane.active[data-tone='danger']:has(> .pane-header)::before {
|
|
395
|
+
border-color: var(--danger);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
:where(.listing-root) .pane-tab[data-tone='danger'],
|
|
399
|
+
:where(.listing-root) .pane-tab[data-tone='danger']:is(:hover, .picked),
|
|
400
|
+
:where(.listing-root) .pane.active .pane-tab.active[data-tone='danger'],
|
|
401
|
+
:where(.listing-root) .pane[data-tone='danger'] .pane-tab.active,
|
|
402
|
+
:where(.listing-root) .pane.active[data-tone='danger'] .pane-tab.active,
|
|
403
|
+
:where(:root[data-window-inactive] .listing-root) .pane.active[data-tone='danger'] .pane-tab.active,
|
|
404
|
+
:where(:root[data-window-inactive] .listing-root)
|
|
405
|
+
.pane.active
|
|
406
|
+
.pane-tab.active[data-tone='danger'] {
|
|
407
|
+
border-color: var(--danger);
|
|
408
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** How far the pointer travels before a press on a tab becomes a drag, in pixels. */
|
|
2
|
+
export declare const DRAG_SLOP = 4;
|
|
3
|
+
/** What a drag needs from its strip; the strip hands it over after every layout. */
|
|
4
|
+
export interface TabStripHandle {
|
|
5
|
+
/** Every tab in the order drawn now, folded ones included. */
|
|
6
|
+
readonly order: readonly string[];
|
|
7
|
+
/** The pinned tabs, which move only among themselves. */
|
|
8
|
+
readonly pinned: ReadonlySet<string>;
|
|
9
|
+
/** The strip's tabs element, whose padding edge a drag's offsets count from. */
|
|
10
|
+
readonly strip: HTMLElement | null;
|
|
11
|
+
/** A drop that changed the order: the strip hands it to its host. */
|
|
12
|
+
readonly commit: (order: readonly string[]) => void;
|
|
13
|
+
}
|
|
14
|
+
/** What a press on a picked tab adds to a drag. */
|
|
15
|
+
export interface CarriedTabs {
|
|
16
|
+
/** Every tab the drag carries, the pressed one among them. */
|
|
17
|
+
readonly ids: readonly string[];
|
|
18
|
+
/** Runs when the press ends without a drag: a plain click on the tab. */
|
|
19
|
+
readonly onClick: () => void;
|
|
20
|
+
}
|
|
21
|
+
/** One strip's drag. */
|
|
22
|
+
export interface TabDrag {
|
|
23
|
+
/** The tabs in the hand once the pointer has moved past the slop; none at rest. */
|
|
24
|
+
readonly draggingIds: readonly string[];
|
|
25
|
+
/** The order the strip draws while a drag runs; null at rest, when the host's order stands. */
|
|
26
|
+
readonly liveOrder: readonly string[] | null;
|
|
27
|
+
/** Starts a possible drag of the tab `id` from a press on `tab` at `clientX`. */
|
|
28
|
+
readonly begin: (id: string, tab: HTMLElement, clientX: number, carried?: CarriedTabs) => void;
|
|
29
|
+
/** A stable ref callback per tab id, so the drag knows where each tab on show is drawn. */
|
|
30
|
+
readonly tabRef: (id: string) => (element: HTMLElement | null) => (() => void) | undefined;
|
|
31
|
+
/** The strip has laid out: the drag reads its handle and keeps the hand under the pointer. */
|
|
32
|
+
readonly afterLayout: (handle: TabStripHandle) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Dragging a strip's tabs to reorder them. The held tab follows the pointer
|
|
36
|
+
* along the strip, lifted over its neighbours, and the strip reorders under
|
|
37
|
+
* it: a neighbour steps aside once the held tab covers half of it
|
|
38
|
+
* (`draggedTabOrder`). An unpinned tab stops at the pin rule and a pinned
|
|
39
|
+
* one moves only among the pinned; the hand never goes past the last tab on
|
|
40
|
+
* show, so nothing drops among the folded tabs. Picked tabs close up round
|
|
41
|
+
* the held one as the drag starts (`gatherTabs`) and ride as one block.
|
|
42
|
+
*
|
|
43
|
+
* Escape (or the window losing the focus, or a cancelled pointer) puts
|
|
44
|
+
* every tab back; the Escape is the drag's alone, taken on the window's
|
|
45
|
+
* capture ahead of every other handler, with its repeats until it comes up. Release hands the new order
|
|
46
|
+
* to the strip's `commit` when it changed. The window follows the pointer,
|
|
47
|
+
* since a reordered tab moves in the document and would drop a capture.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useTabDrag(): TabDrag;
|