@liberation-data/desk 0.40.1 → 0.42.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.
- package/README.md +61 -8
- package/dist/css/controls.css +21 -2
- package/dist/css/dock.css +1 -1
- package/dist/css/looks.css +50 -4
- package/dist/css/tokens.css +1 -0
- package/dist/css/windows.css +165 -6
- package/dist/desk.css +238 -13
- package/dist/react/Desktop.d.ts +12 -3
- package/dist/react/Desktop.d.ts.map +1 -1
- package/dist/react/Desktop.js +20 -10
- package/dist/react/Desktop.js.map +1 -1
- package/dist/react/MenuBar.d.ts +9 -2
- package/dist/react/MenuBar.d.ts.map +1 -1
- package/dist/react/MenuBar.js +15 -0
- package/dist/react/MenuBar.js.map +1 -1
- package/dist/react/arrange.d.ts +6 -0
- package/dist/react/arrange.d.ts.map +1 -1
- package/dist/react/arrange.js +21 -0
- package/dist/react/arrange.js.map +1 -1
- package/dist/react/hostMenu.d.ts +6 -0
- package/dist/react/hostMenu.d.ts.map +1 -1
- package/dist/react/hostMenu.js +1 -0
- package/dist/react/hostMenu.js.map +1 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +2 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/tabs.d.ts +7 -1
- package/dist/react/tabs.d.ts.map +1 -1
- package/dist/react/tabs.js +13 -8
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/widgets.d.ts +33 -0
- package/dist/react/widgets.d.ts.map +1 -0
- package/dist/react/widgets.js +213 -0
- package/dist/react/widgets.js.map +1 -0
- package/llms.txt +33 -7
- package/package.json +2 -2
- package/src/css/controls.css +21 -2
- package/src/css/dock.css +1 -1
- package/src/css/looks.css +50 -4
- package/src/css/tokens.css +1 -0
- package/src/css/windows.css +165 -6
- package/src/react/Desktop.tsx +33 -11
- package/src/react/MenuBar.tsx +20 -2
- package/src/react/arrange.ts +23 -0
- package/src/react/hostMenu.ts +7 -0
- package/src/react/index.ts +3 -1
- package/src/react/tabs.tsx +23 -10
- package/src/react/widgets.tsx +265 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# desk
|
|
2
2
|
|
|
3
|
-
A desktop for
|
|
3
|
+
A desktop environment for React apps: windows that fill the desk, layered, and arrange when asked.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -119,8 +119,8 @@ same way.
|
|
|
119
119
|
/>
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
`info` puts an (i)
|
|
123
|
-
keeps it in the same place, so somebody who wonders what they are looking at always knows where to ask;
|
|
122
|
+
`info` puts an (i) on the far edge of the title bar, opposite the controls — at the end on a Mac, at the
|
|
123
|
+
start on GNOME and Windows — holding what this window is. Every window that has one keeps it in the same place, so somebody who wonders what they are looking at always knows where to ask;
|
|
124
124
|
a window with nothing to explain has none. Explanation only, as with `InfoTip` — a warning belongs in the
|
|
125
125
|
window itself.
|
|
126
126
|
|
|
@@ -230,6 +230,56 @@ a menu stays reachable, so something that can no longer open can still be remove
|
|
|
230
230
|
A stack can be kept the same way: `dockStack({ …, movable: true, contextMenu })` takes drops, is carried
|
|
231
231
|
along the dock, and offers its own right-click menu.
|
|
232
232
|
|
|
233
|
+
## Widgets
|
|
234
|
+
|
|
235
|
+
Glances on the desk itself, for state that is always there and is not worth a window: what is loaded, a
|
|
236
|
+
job's progress, a connection. Each opens the window it is about, which says the same in full.
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
const widgets: Widget[] = [
|
|
240
|
+
{
|
|
241
|
+
id: 'due',
|
|
242
|
+
label: 'Service',
|
|
243
|
+
content: <><Led color="amber" /> 2 jobs due</>,
|
|
244
|
+
onSelect: () => desk.open('service'),
|
|
245
|
+
},
|
|
246
|
+
{ id: 'distance', label: 'This fortnight', content: <b>231 km</b>, onSelect: () => desk.open('rides') },
|
|
247
|
+
]
|
|
248
|
+
|
|
249
|
+
<Desktop title={id => TITLES[id]} renderWindow={renderWindow} widgets={widgets} />
|
|
250
|
+
|
|
251
|
+
// The Window menu: "Widgets in front", a tick for each.
|
|
252
|
+
{ id: 'window', label: 'Window', items: () => [
|
|
253
|
+
menuCommand('Arrange', DeskCommands.arrange, { shortcut: 'mod+alt+a' }),
|
|
254
|
+
...(widgets.length ? [menuSeparator(), ...widgetMenuItems(widgets)] : []),
|
|
255
|
+
] }
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
They stack in a corner of the desk, `top-right` unless `widgetCorner` says `top-left`, `bottom-left` or
|
|
259
|
+
`bottom-right`, in the order given, clear of the dock wherever `<Desktop>` does. Each is as tall as its content
|
|
260
|
+
and `--desk-widget-width` (200px) wide; more than the desk is tall scroll. A desk 640px wide or less, or 400px
|
|
261
|
+
tall or less, and the one-window-at-a-time layout, show none.
|
|
262
|
+
|
|
263
|
+
**Behind the windows** is where they are, on the desk surface. `widgetMenuItems(widgets)` gives the Window
|
|
264
|
+
menu a "Widgets in front" header and a checkable item for each (`menuitemcheckbox`); a tick keeps that widget
|
|
265
|
+
in front of the windows, in a frame of the dock's glass around an opaque surface, and nearest the corner, ahead of
|
|
266
|
+
those behind; it is remembered in this browser under `desk.widgets.<id>`.
|
|
267
|
+
`isWidgetInFront(id)`, `setWidgetInFront(id, front)` and `useWidgetsInFront()` read and change the same choice.
|
|
268
|
+
It returns nothing when there are no widgets, so the section goes with them. Window → Arrange leaves the corner of
|
|
269
|
+
the widgets in front to them, taking a column or a strip along the edge, whichever leaves the windows more room,
|
|
270
|
+
and the strip stops where the widgets behind begin, so the windows cover those whole; widgets behind take nothing.
|
|
271
|
+
|
|
272
|
+
With `onSelect` a widget is a button, so its `content` holds no controls of its own; without it, it only
|
|
273
|
+
shows. `label` says what it is: it is read before the content and not drawn, so don't repeat it there; it is
|
|
274
|
+
also the widget's name in the Window menu. A widget behind the windows that a window covers is `inert`, so Tab
|
|
275
|
+
and a screen reader pass it by; one with no window over it, or kept in front, can be reached. Those that can be
|
|
276
|
+
clicked are one tab stop, with the arrow keys along them; Escape goes back to the key window. A widget taken
|
|
277
|
+
away while it has the keyboard hands it to the next one, or to the key window, and so does one a window comes
|
|
278
|
+
over.
|
|
279
|
+
|
|
280
|
+
Nothing is read out as content changes. `announce` is said, politely, when it changes: give it for what
|
|
281
|
+
somebody would want to hear, such as "Backup finished", and not for every percent of the way there.
|
|
282
|
+
|
|
233
283
|
## Inside a window: a pane
|
|
234
284
|
|
|
235
285
|
```tsx
|
|
@@ -339,7 +389,9 @@ tab stop whose arrow keys move the selection past disabled options. Its selectio
|
|
|
339
389
|
than the track on a dark ground and on a light one, which slides to the option chosen. Tabs look similar and are not the same
|
|
340
390
|
thing: a segmented control chooses a value and what it governs stays on screen, while tabs switch the view
|
|
341
391
|
beneath them, which sits in a panel the selected tab names. `actions` puts controls for the whole window,
|
|
342
|
-
such as Refresh, at the end of the strip, so a window with tabs needs no header row above them. A
|
|
392
|
+
such as Refresh, at the end of the strip, so a window with tabs needs no header row above them. A tab that
|
|
393
|
+
can't be chosen yet takes `disabled`, or a string saying why (`disabled: 'Waiting for the aerial photo'`),
|
|
394
|
+
which a screen reader hears and a pointer sees on hover. A toggle is a `switch` for settings that
|
|
343
395
|
apply at once — a checkbox is for one that waits for Save. A text field always has a label (`labelHidden`
|
|
344
396
|
keeps it for screen readers), and an `error` marks it invalid and replaces the help text. A choice group
|
|
345
397
|
is the handful of cards a setup step turns on — an icon, a label, a line of why — with native radios
|
|
@@ -751,7 +803,7 @@ it. All three overlays trap focus, give it back on close, and answer Escape topm
|
|
|
751
803
|
## Menu bar
|
|
752
804
|
|
|
753
805
|
```tsx
|
|
754
|
-
import { MenuBar, menuAction, menuCommand, menuSeparator, windowMenuItems } from '@liberation-data/desk/react'
|
|
806
|
+
import { MenuBar, menuAction, menuCommand, menuSeparator, widgetMenuItems, windowMenuItems } from '@liberation-data/desk/react'
|
|
755
807
|
|
|
756
808
|
<MenuBar
|
|
757
809
|
leading={<AppMark />}
|
|
@@ -760,6 +812,7 @@ import { MenuBar, menuAction, menuCommand, menuSeparator, windowMenuItems } from
|
|
|
760
812
|
menuCommand('Settings…', 'app.settings', { shortcut: 'mod+comma' })] },
|
|
761
813
|
{ id: 'window', label: 'Window', items: () => [ // a function: re-read each time it opens
|
|
762
814
|
menuCommand('Arrange', DeskCommands.arrange),
|
|
815
|
+
...(widgets.length ? [menuSeparator(), ...widgetMenuItems(widgets)] : []), // "Widgets in front"
|
|
763
816
|
menuSeparator(),
|
|
764
817
|
...windowMenuItems(desk.getState(), desk.focus, titleOf),
|
|
765
818
|
] },
|
|
@@ -782,8 +835,8 @@ empty list when it unmounts. A status menu crosses with its `label`, since a nat
|
|
|
782
835
|
`leading` and `trailing` do not cross at all, so anything the host should show is a menu. The host gives a
|
|
783
836
|
shortcut with `mod` in it a key of its own and the page binds the rest, unless the host says otherwise with
|
|
784
837
|
`ownsShortcut`; `shortcuts={false}` stops only the page's binding, as the host still gets every shortcut to show.
|
|
785
|
-
An action item's shortcut crosses
|
|
786
|
-
|
|
838
|
+
An action item's shortcut crosses marked `showOnly`: as in the drawn bar, it is a label for a key the app binds
|
|
839
|
+
itself, so the host shows it and gives it no key of its own.
|
|
787
840
|
Enablement is published on each render and focus move, so one that changes through app state alone shows
|
|
788
841
|
stale in the host until the next; a stale item the host sends back is asked again and does nothing.
|
|
789
842
|
|
|
@@ -1043,7 +1096,7 @@ npm install
|
|
|
1043
1096
|
npm test # vitest
|
|
1044
1097
|
npm run typecheck
|
|
1045
1098
|
npm run example # the Garage sample in examples/garage
|
|
1046
|
-
npm run size # the gzipped budget: core 16 KiB, react
|
|
1099
|
+
npm run size # the gzipped budget: core 16 KiB, react 76, css 22, fx 5
|
|
1047
1100
|
npm run check # everything CI runs
|
|
1048
1101
|
npm run check:browser # the generated-app bridge in real Chrome, against a running sample
|
|
1049
1102
|
npm run build # dist/
|
package/dist/css/controls.css
CHANGED
|
@@ -816,7 +816,7 @@
|
|
|
816
816
|
transition: background .12s var(--desk-ease), color .12s var(--desk-ease);
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
.desk-tab:hover:not(:disabled):not([aria-selected="true"]) {
|
|
819
|
+
.desk-tab:hover:not(:disabled):not([aria-disabled="true"]):not([aria-selected="true"]) {
|
|
820
820
|
background: color-mix(in srgb, var(--desk-ink) 6%, transparent);
|
|
821
821
|
color: var(--desk-ink);
|
|
822
822
|
}
|
|
@@ -832,11 +832,30 @@
|
|
|
832
832
|
outline-offset: -2px;
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
-
.desk-tab:disabled
|
|
835
|
+
.desk-tab:disabled,
|
|
836
|
+
.desk-tab[aria-disabled="true"] {
|
|
836
837
|
opacity: .45;
|
|
837
838
|
cursor: default;
|
|
838
839
|
}
|
|
839
840
|
|
|
841
|
+
/* An unavailable tab the arrows stop on: the ring is drawn in full, the label stays dimmed. */
|
|
842
|
+
.desk-tab[aria-disabled="true"]:focus-visible {
|
|
843
|
+
opacity: 1;
|
|
844
|
+
color: color-mix(in srgb, var(--desk-muted) 45%, transparent);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/* Why a tab is unavailable: read by a screen reader, shown to a pointer as the tab's title. */
|
|
848
|
+
.desk-tab-why {
|
|
849
|
+
position: absolute;
|
|
850
|
+
width: 1px;
|
|
851
|
+
height: 1px;
|
|
852
|
+
margin: -1px;
|
|
853
|
+
padding: 0;
|
|
854
|
+
overflow: hidden;
|
|
855
|
+
clip-path: inset(50%);
|
|
856
|
+
white-space: nowrap;
|
|
857
|
+
}
|
|
858
|
+
|
|
840
859
|
.desk-tab-badge {
|
|
841
860
|
min-width: 18px;
|
|
842
861
|
padding: 0 5px;
|
package/dist/css/dock.css
CHANGED
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
height: 100%;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
/* A dot for "a window is open", brighter when it has focus. */
|
|
224
|
+
/* A dot for "a window is open", brighter when it has focus: a 4px dot 2px off its tile. */
|
|
225
225
|
.desk-dock-item[data-running]::after {
|
|
226
226
|
content: "";
|
|
227
227
|
position: absolute;
|
package/dist/css/looks.css
CHANGED
|
@@ -50,11 +50,20 @@
|
|
|
50
50
|
font-size: var(--desk-text-small);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/*
|
|
54
|
-
|
|
53
|
+
/*
|
|
54
|
+
* The end of the bar is the controls', so the (i) is at its start, on the far edge (it is first in the
|
|
55
|
+
* document). It takes the spare room after it, and nothing else in the bar reaches for any: an auto
|
|
56
|
+
* margin on both sides of it would centre it in the room, under the heading.
|
|
57
|
+
*/
|
|
58
|
+
[data-look="gnome"] .desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
59
|
+
margin-left: 0;
|
|
55
60
|
margin-right: auto;
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
[data-look="gnome"] .desk-window-actions {
|
|
64
|
+
margin-left: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
/*
|
|
59
68
|
* The middle is the heading's, so the count waits at the end of the bar, before the controls, and
|
|
60
69
|
* the heading keeps clear of both. A narrow bar keeps the count and lets the track go.
|
|
@@ -62,6 +71,7 @@
|
|
|
62
71
|
[data-look="gnome"] .desk-window-progress {
|
|
63
72
|
position: static;
|
|
64
73
|
transform: none;
|
|
74
|
+
margin-left: 0;
|
|
65
75
|
}
|
|
66
76
|
|
|
67
77
|
[data-look="gnome"] .desk-titlebar[data-progress] .desk-titlebar-heading {
|
|
@@ -139,6 +149,11 @@
|
|
|
139
149
|
height: 5px;
|
|
140
150
|
}
|
|
141
151
|
|
|
152
|
+
/* The (i) is first in the document, at the start of the bar: the end is the controls'. */
|
|
153
|
+
[data-look="windows"] .desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
154
|
+
margin-left: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
142
157
|
[data-look="windows"] .desk-title {
|
|
143
158
|
flex: 1 1 auto;
|
|
144
159
|
font-size: var(--desk-text-small);
|
|
@@ -191,7 +206,8 @@
|
|
|
191
206
|
* inside them, come out dark too — as the shell's own menus do.
|
|
192
207
|
*/
|
|
193
208
|
[data-look="gnome"] .desk-menubar,
|
|
194
|
-
[data-look="gnome"] .desk-dock
|
|
209
|
+
[data-look="gnome"] .desk-dock,
|
|
210
|
+
[data-look="gnome"] .desk-widget[data-front] {
|
|
195
211
|
--desk-ink: #ffffff;
|
|
196
212
|
--desk-muted: rgb(255 255 255 / 68%);
|
|
197
213
|
--desk-surface: #2a2a2a;
|
|
@@ -226,8 +242,13 @@
|
|
|
226
242
|
color: var(--desk-ink);
|
|
227
243
|
}
|
|
228
244
|
|
|
229
|
-
|
|
245
|
+
/* A widget kept in front is the dash's material too. */
|
|
246
|
+
[data-look="gnome"] .desk-dock,
|
|
247
|
+
[data-look="gnome"] .desk-widget[data-front] {
|
|
230
248
|
--desk-dock-glass: rgb(24 24 24 / 86%);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
[data-look="gnome"] .desk-dock {
|
|
231
252
|
border-radius: 20px;
|
|
232
253
|
}
|
|
233
254
|
|
|
@@ -236,6 +257,31 @@
|
|
|
236
257
|
border-radius: 12px;
|
|
237
258
|
}
|
|
238
259
|
|
|
260
|
+
/*
|
|
261
|
+
* The running dot by the glyph, as GNOME's dash has it: its tiles are transparent, so 3px off a tile no one sees is out
|
|
262
|
+
* by the dock's edge. The glyph is 46% of its item, centred (a stack's 72%), so its edge is 27% (14%) in; the 4px dot
|
|
263
|
+
* stands 4px off that, on whichever side the dock is.
|
|
264
|
+
*/
|
|
265
|
+
[data-look="gnome"] .desk-dock {
|
|
266
|
+
--desk-dock-dot-glyph: calc(27% - 8px);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
[data-look="gnome"] .desk-dock .desk-dock-item[data-stack] {
|
|
270
|
+
--desk-dock-dot-glyph: calc(14% - 8px);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
[data-look="gnome"] .desk-dock[data-side="bottom"] .desk-dock-item[data-running]::after {
|
|
274
|
+
bottom: var(--desk-dock-dot-glyph);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
[data-look="gnome"] .desk-dock[data-side="left"] .desk-dock-item[data-running]::after {
|
|
278
|
+
left: var(--desk-dock-dot-glyph);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
[data-look="gnome"] .desk-dock[data-side="right"] .desk-dock-item[data-running]::after {
|
|
282
|
+
right: var(--desk-dock-dot-glyph);
|
|
283
|
+
}
|
|
284
|
+
|
|
239
285
|
/* No magnification: GNOME's dash lights an item up rather than growing it. */
|
|
240
286
|
[data-look="gnome"] .desk-dock .desk-dock-item:hover:not(:disabled),
|
|
241
287
|
[data-look="windows"] .desk-dock .desk-dock-item:hover:not(:disabled) {
|
package/dist/css/tokens.css
CHANGED
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
--desk-dock-icon: linear-gradient(160deg, #ffffff, #eceff5);
|
|
86
86
|
--desk-badge: #ef4444;
|
|
87
87
|
--desk-badge-ink: #ffffff;
|
|
88
|
+
--desk-widget-width: 200px;
|
|
88
89
|
/* Room the stage leaves at the bottom for something of the app's own. An overlay dock makes its own. */
|
|
89
90
|
--desk-inset-bottom: 0px;
|
|
90
91
|
}
|
package/dist/css/windows.css
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.desk-window {
|
|
19
|
-
/*
|
|
19
|
+
/* Windows are placed inside the stage's padding; filled ones, below, fill it to its edges, layered in the order they were used. */
|
|
20
20
|
position: absolute;
|
|
21
21
|
top: var(--desk-padding);
|
|
22
22
|
right: var(--desk-padding);
|
|
@@ -55,6 +55,18 @@
|
|
|
55
55
|
grid-area: 1 / 1;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/*
|
|
59
|
+
* A filled window takes the whole desk, as a zoomed window does on a Mac: no margin, no corners, no shadow. The
|
|
60
|
+
* stage's padding stays for the windows that are arranged or free, and for a filled one that is capped and sits
|
|
61
|
+
* in the middle of the room.
|
|
62
|
+
*/
|
|
63
|
+
.desk-window[data-mode="filled"]:not([data-centred]) {
|
|
64
|
+
inset: 0 0 var(--desk-inset-bottom) 0;
|
|
65
|
+
border-color: transparent;
|
|
66
|
+
border-radius: 0;
|
|
67
|
+
box-shadow: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
58
70
|
.desk-window[data-mode="floating"] {
|
|
59
71
|
right: auto;
|
|
60
72
|
bottom: auto;
|
|
@@ -174,16 +186,18 @@
|
|
|
174
186
|
color: var(--desk-muted);
|
|
175
187
|
}
|
|
176
188
|
|
|
177
|
-
/* The note gives up the spare room; the (i) keeps its place at the end of the bar. */
|
|
178
189
|
/*
|
|
179
|
-
* The (i) is the bar's
|
|
180
|
-
*
|
|
190
|
+
* The (i) is on the bar's far edge, opposite the controls: here, on a Mac, it is the bar's last word, after
|
|
191
|
+
* the note and the actions. Whatever comes before it takes the spare room, and it follows. It sits in its
|
|
192
|
+
* popover's anchor, so the anchor is what the bar lays out: a margin on the button inside it would move
|
|
193
|
+
* nothing. The other looks put it first, and say so in looks.css.
|
|
181
194
|
*/
|
|
182
195
|
.desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
183
196
|
margin-left: auto;
|
|
184
197
|
}
|
|
185
198
|
|
|
186
|
-
.desk-window-note ~ .desk-popover-anchor:has(> .desk-window-info)
|
|
199
|
+
.desk-window-note ~ .desk-popover-anchor:has(> .desk-window-info),
|
|
200
|
+
.desk-window-actions ~ .desk-popover-anchor:has(> .desk-window-info) {
|
|
187
201
|
margin-left: var(--desk-space-2);
|
|
188
202
|
}
|
|
189
203
|
|
|
@@ -232,6 +246,12 @@
|
|
|
232
246
|
margin-left: var(--desk-space-3);
|
|
233
247
|
}
|
|
234
248
|
|
|
249
|
+
/* The count has taken the spare room, so what follows it keeps to it rather than splitting the room. */
|
|
250
|
+
.desk-window-progress ~ .desk-window-actions,
|
|
251
|
+
.desk-window-progress ~ .desk-popover-anchor:has(> .desk-window-info) {
|
|
252
|
+
margin-left: var(--desk-space-2);
|
|
253
|
+
}
|
|
254
|
+
|
|
235
255
|
.desk-titlebar[data-progress] .desk-title,
|
|
236
256
|
.desk-titlebar[data-progress] .desk-window-note {
|
|
237
257
|
max-width: none;
|
|
@@ -259,7 +279,13 @@
|
|
|
259
279
|
.desk-window-progress-fill { transition: none; }
|
|
260
280
|
}
|
|
261
281
|
|
|
262
|
-
|
|
282
|
+
/* Narrower still, the count keeps its words and lets the track go, so the bar's far edge stays on the bar. */
|
|
283
|
+
@container (max-width: 400px) {
|
|
284
|
+
.desk-window-progress-track {
|
|
285
|
+
display: none;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
263
289
|
.desk-window-note + .desk-window-actions {
|
|
264
290
|
margin-left: var(--desk-space-1);
|
|
265
291
|
}
|
|
@@ -400,6 +426,139 @@
|
|
|
400
426
|
right: var(--desk-padding);
|
|
401
427
|
}
|
|
402
428
|
|
|
429
|
+
/* ── Widgets: glances in a corner of the stage, behind the windows unless the person keeps one in front ── */
|
|
430
|
+
|
|
431
|
+
/* As big as the stage, to ask its size. No z-index, so each widget stands behind or in front on its own. */
|
|
432
|
+
.desk-widgets {
|
|
433
|
+
container: desk-widgets / size;
|
|
434
|
+
position: absolute;
|
|
435
|
+
inset: 0;
|
|
436
|
+
pointer-events: none;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/*
|
|
440
|
+
* A margin of padding for the focus ring, which a list that scrolls would clip. Too many for the desk, and it
|
|
441
|
+
* scrolls: it takes the pointer, as a scroller without it is passed over by the wheel, a finger and its scrollbar.
|
|
442
|
+
*/
|
|
443
|
+
.desk-widget-list {
|
|
444
|
+
position: absolute;
|
|
445
|
+
pointer-events: auto;
|
|
446
|
+
box-sizing: border-box;
|
|
447
|
+
width: calc(var(--desk-widget-width) + 2 * var(--desk-space-1));
|
|
448
|
+
max-height: calc(100% - 2 * (var(--desk-padding) - var(--desk-space-1)) - var(--desk-inset-bottom));
|
|
449
|
+
padding: var(--desk-space-1);
|
|
450
|
+
display: flex;
|
|
451
|
+
flex-direction: column;
|
|
452
|
+
gap: var(--desk-space-2);
|
|
453
|
+
overflow: hidden auto;
|
|
454
|
+
scrollbar-width: thin;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.desk-widgets[data-corner^="top"] > .desk-widget-list {
|
|
458
|
+
top: calc(var(--desk-padding) - var(--desk-space-1));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
.desk-widgets[data-corner^="bottom"] > .desk-widget-list {
|
|
462
|
+
bottom: calc(var(--desk-padding) - var(--desk-space-1) + var(--desk-inset-bottom));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.desk-widgets[data-corner$="left"] > .desk-widget-list {
|
|
466
|
+
left: calc(var(--desk-padding) - var(--desk-space-1));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.desk-widgets[data-corner$="right"] > .desk-widget-list {
|
|
470
|
+
right: calc(var(--desk-padding) - var(--desk-space-1));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/* Behind: on the desk surface, over what the app draws on an empty desk; windows start at 10. */
|
|
474
|
+
.desk-widget {
|
|
475
|
+
flex: none;
|
|
476
|
+
box-sizing: border-box;
|
|
477
|
+
position: relative;
|
|
478
|
+
z-index: 1;
|
|
479
|
+
min-height: 44px;
|
|
480
|
+
padding: 0;
|
|
481
|
+
border: 1px solid var(--desk-rule);
|
|
482
|
+
border-radius: var(--desk-radius);
|
|
483
|
+
background: var(--desk-surface);
|
|
484
|
+
color: var(--desk-ink);
|
|
485
|
+
font-family: var(--desk-font);
|
|
486
|
+
font-size: var(--desk-text-body);
|
|
487
|
+
text-align: start;
|
|
488
|
+
overflow: clip;
|
|
489
|
+
overflow-wrap: anywhere;
|
|
490
|
+
user-select: none;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/* Its words, on an opaque surface. */
|
|
494
|
+
.desk-widget-surface {
|
|
495
|
+
display: block;
|
|
496
|
+
box-sizing: border-box;
|
|
497
|
+
min-height: 42px;
|
|
498
|
+
padding: var(--desk-space-2) var(--desk-space-3);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/* In front, by choice: a frame of the dock's glass round that surface, as a stack's panel. No shadow: the list clips it. */
|
|
502
|
+
.desk-widget[data-front] {
|
|
503
|
+
z-index: 800;
|
|
504
|
+
padding: var(--desk-space-1);
|
|
505
|
+
background: var(--desk-dock-glass);
|
|
506
|
+
backdrop-filter: blur(28px) saturate(170%);
|
|
507
|
+
-webkit-backdrop-filter: blur(28px) saturate(170%);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.desk-widget[data-front] > .desk-widget-surface {
|
|
511
|
+
/* The frame comes out of the padding: ticking one keeps its size. */
|
|
512
|
+
min-height: calc(42px - 2 * var(--desk-space-1));
|
|
513
|
+
padding: calc(var(--desk-space-2) - var(--desk-space-1)) calc(var(--desk-space-3) - var(--desk-space-1));
|
|
514
|
+
border-radius: max(0px, calc(var(--desk-radius) - var(--desk-space-1)));
|
|
515
|
+
background: var(--desk-surface);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
button.desk-widget {
|
|
519
|
+
cursor: pointer;
|
|
520
|
+
transition: border-color .12s var(--desk-ease);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
button.desk-widget:hover {
|
|
524
|
+
border-color: color-mix(in srgb, var(--desk-accent) 45%, var(--desk-rule));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.desk-widget:focus-visible {
|
|
528
|
+
outline: 2px solid var(--desk-accent);
|
|
529
|
+
outline-offset: 2px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/* A tour pointing at them moves nothing, and its ring fits in that margin too. */
|
|
533
|
+
.desk-widget-list[data-desk-tour-pointed] {
|
|
534
|
+
position: absolute;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.desk-widget[data-desk-tour-pointed] {
|
|
538
|
+
outline-offset: 2px;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.desk-widget-unseen {
|
|
542
|
+
position: absolute;
|
|
543
|
+
width: 1px;
|
|
544
|
+
height: 1px;
|
|
545
|
+
overflow: hidden;
|
|
546
|
+
clip-path: inset(50%);
|
|
547
|
+
white-space: nowrap;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/* A desk this small belongs to the windows. */
|
|
551
|
+
@container desk-widgets (max-width: 640px) or (max-height: 400px) {
|
|
552
|
+
.desk-widget-list,
|
|
553
|
+
.desk-widgets > .desk-widget-unseen {
|
|
554
|
+
display: none;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
@media (forced-colors: active) {
|
|
559
|
+
button.desk-widget:hover { border-color: Highlight; }
|
|
560
|
+
}
|
|
561
|
+
|
|
403
562
|
/* ── The inside of a window: controls that stay, content that scrolls ── */
|
|
404
563
|
|
|
405
564
|
/* Two panels in one window, and the edge between them that moves. */
|