@liberation-data/desk 0.41.0 → 0.43.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 +152 -9
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/scheme.d.ts +12 -0
- package/dist/core/scheme.d.ts.map +1 -0
- package/dist/core/scheme.js +15 -0
- package/dist/core/scheme.js.map +1 -0
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/css/apps.css +149 -0
- package/dist/css/controls.css +21 -2
- package/dist/css/dock.css +1 -1
- package/dist/css/looks.css +50 -4
- package/dist/css/overlays.css +6 -0
- package/dist/css/tokens.css +1 -0
- package/dist/css/windows.css +173 -5
- package/dist/desk.css +401 -12
- package/dist/react/Desktop.d.ts +12 -3
- package/dist/react/Desktop.d.ts.map +1 -1
- package/dist/react/Desktop.js +29 -9
- package/dist/react/Desktop.js.map +1 -1
- package/dist/react/Dock.d.ts +6 -1
- package/dist/react/Dock.d.ts.map +1 -1
- package/dist/react/Dock.js +9 -1
- package/dist/react/Dock.js.map +1 -1
- package/dist/react/MenuBar.d.ts +8 -1
- package/dist/react/MenuBar.d.ts.map +1 -1
- package/dist/react/MenuBar.js +34 -5
- package/dist/react/MenuBar.js.map +1 -1
- package/dist/react/app.d.ts +174 -0
- package/dist/react/app.d.ts.map +1 -0
- package/dist/react/app.js +146 -0
- package/dist/react/app.js.map +1 -0
- package/dist/react/appPanels.d.ts +22 -0
- package/dist/react/appPanels.d.ts.map +1 -0
- package/dist/react/appPanels.js +114 -0
- package/dist/react/appPanels.js.map +1 -0
- package/dist/react/appearance.d.ts +55 -0
- package/dist/react/appearance.d.ts.map +1 -0
- package/dist/react/appearance.js +140 -0
- package/dist/react/appearance.js.map +1 -0
- 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/codeBlock.d.ts.map +1 -1
- package/dist/react/codeBlock.js +6 -60
- package/dist/react/codeBlock.js.map +1 -1
- package/dist/react/context.d.ts +9 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.js +47 -3
- package/dist/react/context.js.map +1 -1
- package/dist/react/copy.d.ts +22 -0
- package/dist/react/copy.d.ts.map +1 -0
- package/dist/react/copy.js +68 -0
- package/dist/react/copy.js.map +1 -0
- package/dist/react/documentTitle.d.ts.map +1 -1
- package/dist/react/documentTitle.js +4 -1
- package/dist/react/documentTitle.js.map +1 -1
- package/dist/react/index.d.ts +10 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +7 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/layers.d.ts.map +1 -1
- package/dist/react/layers.js +7 -2
- package/dist/react/layers.js.map +1 -1
- package/dist/react/overlays.d.ts.map +1 -1
- package/dist/react/overlays.js +29 -12
- package/dist/react/overlays.js.map +1 -1
- package/dist/react/shell.d.ts +4 -1
- package/dist/react/shell.d.ts.map +1 -1
- package/dist/react/shell.js +2 -2
- package/dist/react/shell.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 +75 -8
- package/package.json +1 -1
- package/src/core/index.ts +2 -0
- package/src/core/scheme.ts +21 -0
- package/src/core/types.ts +6 -0
- package/src/css/apps.css +149 -0
- package/src/css/controls.css +21 -2
- package/src/css/dock.css +1 -1
- package/src/css/looks.css +50 -4
- package/src/css/overlays.css +6 -0
- package/src/css/tokens.css +1 -0
- package/src/css/windows.css +173 -5
- package/src/react/Desktop.tsx +50 -12
- package/src/react/Dock.tsx +11 -1
- package/src/react/MenuBar.tsx +38 -5
- package/src/react/app.tsx +284 -0
- package/src/react/appPanels.tsx +197 -0
- package/src/react/appearance.tsx +204 -0
- package/src/react/arrange.ts +23 -0
- package/src/react/codeBlock.tsx +7 -65
- package/src/react/context.tsx +55 -3
- package/src/react/copy.ts +81 -0
- package/src/react/documentTitle.ts +4 -1
- package/src/react/index.ts +30 -1
- package/src/react/layers.ts +7 -2
- package/src/react/overlays.tsx +30 -12
- package/src/react/shell.tsx +5 -2
- package/src/react/tabs.tsx +23 -10
- package/src/react/widgets.tsx +265 -0
package/llms.txt
CHANGED
|
@@ -177,6 +177,7 @@ formatShortcut('mod+comma', apple?): string // '⌘,' or 'Ctrl+,'
|
|
|
177
177
|
isApplePlatform(): boolean // the KEYBOARD; the look is separate
|
|
178
178
|
deviceLook(): Look // 'mac' | 'gnome' | 'windows' for this device
|
|
179
179
|
lookFor(platform, userAgent): Look // the same, pure; resolveLook('auto' | Look): Look
|
|
180
|
+
COLOR_SCHEME_KEY; LOOK_KEY; COLOR_SCHEME_SCRIPT // Appearance's storage keys and <head> script; see Settings and About
|
|
180
181
|
isInstalledApp(): boolean // gate ⌘W / ⌘` on this; never take ⌘T or ⌘N
|
|
181
182
|
titleCase('ride card'): string // 'Ride Card' — app and window names; a document keeps its own name
|
|
182
183
|
isTitleCase(name): boolean // for a test over the names an app defines
|
|
@@ -253,8 +254,8 @@ watchAttention(desk, id, onAttended): () => void // at once if attended, the
|
|
|
253
254
|
### Shell
|
|
254
255
|
|
|
255
256
|
```tsx
|
|
256
|
-
<DeskShell desk?={Desk} options?={DeskOptions} bus?={Bus} toasts?={true} look?={'auto'} services?={Service[]}>
|
|
257
|
-
<DeskProvider desk={desk} look?={'auto'} services?={Service[]}> // or options={…} to make one
|
|
257
|
+
<DeskShell desk?={Desk} options?={DeskOptions} bus?={Bus} toasts?={true} look?={'auto'} services?={Service[]} app?={DeskApp}> // app: see Settings and About
|
|
258
|
+
<DeskProvider desk={desk} look?={'auto'} services?={Service[]} app?={DeskApp}> // or options={…} to make one
|
|
258
259
|
useDesk(): Desk
|
|
259
260
|
useLook(): 'mac' | 'gnome' | 'windows' // resolved; the device's outside a desk
|
|
260
261
|
useDeskState(): DeskState
|
|
@@ -268,18 +269,44 @@ useWindowInfo(info: ReactNode): boolean // this view's (i) in place
|
|
|
268
269
|
renderWindow={(id) => ReactNode} // memoised: chrome re-renders, content does not
|
|
269
270
|
title={(id) => ReactNode}
|
|
270
271
|
note?={(id) => ReactNode} // quiet text in the title bar: what this window is looking at
|
|
271
|
-
info?={(id) => ReactNode} // an (i)
|
|
272
|
-
limits?={(id) => ({ maxWidth?, maxHeight?, minWidth?, minHeight? } | null)} // a window with a natural
|
|
273
|
-
// size is never stretched past it; filled, it centres
|
|
272
|
+
info?={(id) => ReactNode} // an (i) on the bar's far edge from the controls (end on mac, start on gnome/windows): what this window IS
|
|
273
|
+
limits?={(id) => ({ maxWidth?, maxHeight?, minWidth?, minHeight?, fitContent? } | null)} // a window with a natural
|
|
274
|
+
// size is never stretched past it; filled, it centres; fitContent:
|
|
275
|
+
// centred, it is as tall as its content up to maxHeight
|
|
274
276
|
actions?={(id) => ReactNode} // window-wide controls in the title bar
|
|
275
277
|
loading?={(id) => ReactNode} // inside a window while its code loads
|
|
276
278
|
failed?={(id, error, reload) => ReactNode} // inside a window that could not open
|
|
277
279
|
empty?={ReactNode}
|
|
278
280
|
layout?={'auto' | 'desktop' | 'fullscreen'} // auto: touch screens get one window at a time
|
|
281
|
+
widgets?={Widget[]} // glances in a corner of the desk, behind the windows unless kept in front
|
|
282
|
+
widgetCorner?={'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'} // default top-right
|
|
279
283
|
className?={string}
|
|
280
284
|
/>
|
|
281
285
|
```
|
|
282
286
|
|
|
287
|
+
### Widgets
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
interface Widget { id: string; label: string; content: ReactNode; onSelect?: () => void; announce?: string }
|
|
291
|
+
widgetMenuItems(widgets): MenuItem[] // [] for none; else header "Widgets in front" + a checkable item each
|
|
292
|
+
isWidgetInFront(id): boolean
|
|
293
|
+
setWidgetInFront(id, front: boolean): void // remembered in localStorage under `desk.widgets.<id>`
|
|
294
|
+
useWidgetsInFront(): (id) => boolean // re-renders when a tick changes, here or in another tab
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
`<Desktop widgets>` stacks them in order, in one corner, clear of the dock and of each other, **behind the
|
|
298
|
+
windows**. Only the person brings one in front: put `...(widgets.length ? [menuSeparator(), ...widgetMenuItems(widgets)] : [])`
|
|
299
|
+
in the Window menu; a tick keeps that widget in front (a dock-glass frame round an opaque surface; those in front stand nearest the
|
|
300
|
+
corner, ahead of those behind, in DOM order too), and Arrange then lays the windows out
|
|
301
|
+
around its corner (a column or a strip, whichever leaves more room). Widgets behind take no room from Arrange.
|
|
302
|
+
A widget behind that a window covers is `inert`: out of Tab order and the accessibility tree. `onSelect` makes one
|
|
303
|
+
a button (so no controls in `content`) and should open the window it is about; without it, it only shows. `label`
|
|
304
|
+
is read before the content and not drawn (don't repeat it in the content), and names it in the menu. Content
|
|
305
|
+
changes are not announced; `announce` is said politely when it changes. The buttons within reach are one tab stop
|
|
306
|
+
(Up/Down, Home/End; Escape to the key window). Not shown in the fullscreen layout, or when the stage is at most
|
|
307
|
+
640px wide or 400px tall, so never the only place something is said. Width: `--desk-widget-width`. Too many for
|
|
308
|
+
the height scroll.
|
|
309
|
+
|
|
283
310
|
### Loading and failing, per window
|
|
284
311
|
|
|
285
312
|
```tsx
|
|
@@ -350,6 +377,7 @@ menuCommand(label, command, { shortcut?, checked?, detail?, args? })
|
|
|
350
377
|
menuAction(label, onSelect, { disabled?, shortcut?, checked?, detail? })
|
|
351
378
|
menuSeparator(); menuHeader(label)
|
|
352
379
|
windowMenuItems(state, focus, title): MenuItem[]
|
|
380
|
+
widgetMenuItems(widgets): MenuItem[] // "Widgets in front" + a checkable item per widget; [] for none (see Widgets)
|
|
353
381
|
|
|
354
382
|
const { target, menu, open } = useContextMenu({ label, items: () => MenuItem[], disabled? })
|
|
355
383
|
// spread `target` (onContextMenu, onKeyDown) on the element; render `menu` anywhere (portal).
|
|
@@ -365,6 +393,45 @@ Command items are enabled via `canPerform` as the menu opens, and menus bind the
|
|
|
365
393
|
menu does not take focus from the key window, so a chosen command reaches the same responder a shortcut
|
|
366
394
|
would. `items` as a function is re-read on every open.
|
|
367
395
|
|
|
396
|
+
### Settings and About
|
|
397
|
+
|
|
398
|
+
```tsx
|
|
399
|
+
<DeskShell app={DeskApp}> // or DeskProvider app={…}; read on every render, so it may change
|
|
400
|
+
interface DeskApp { name; icon?; version?; description?; links?: { label, url }[]; legal?;
|
|
401
|
+
note?: ReactNode; // a line under the links, not copied
|
|
402
|
+
facts?: () => AboutSection[] | null; // a HOOK, called inside the About panel; null = still reading, [] = nothing, no Copy
|
|
403
|
+
settings?: AppSettings } // leave out: no gear, no "Settings…", no ⌘,
|
|
404
|
+
interface AboutSection { title?; facts: { name; value: string; note?: ReactNode; link?: { label, url }; copy?: false }[] } // copy:false = shown, not copied; note and link never copied
|
|
405
|
+
interface AppSettings { sections?: SettingsSection[]; layout?: 'panel' | 'sidebar'; badge?: ReactNode;
|
|
406
|
+
open?: (route?: string) => void } // open: the app's own Settings window; Desk draws none
|
|
407
|
+
interface SettingsSection { id; title; group?; icon?; badge?; content: ReactNode } // id = the route of `settings`
|
|
408
|
+
// AppSettings.appearance?: true | { scheme?; look?; sounds?: Fx; soundsDescription?; theme?: ReactNode } // Desk's first section
|
|
409
|
+
// DeskApp.themeFromHost?: boolean // receives its theme from a host: no scheme/look/theme rows (sounds stay); default: found from the bridge
|
|
410
|
+
useColorScheme(): 'system'|'light'|'dark'; colorScheme(); setColorScheme(s) // localStorage desk.scheme; data-theme on the root
|
|
411
|
+
useLookChoice(): LookChoice | null; lookChoice(); setLookChoice(l) // localStorage desk.look; replaces the `look` prop
|
|
412
|
+
COLOR_SCHEME_SCRIPT; COLOR_SCHEME_KEY = 'desk.scheme'; LOOK_KEY = 'desk.look' // also from the core entry (no React)
|
|
413
|
+
// script: for <head>, the remembered scheme before first paint; keys: for migrations
|
|
414
|
+
<AppearanceSettings rows look /> // the rows, for an app's own Settings window
|
|
415
|
+
dockSettings(): DockEntry // where the gear goes among the system items; default just before About
|
|
416
|
+
SETTINGS_WINDOW = 'settings'; ABOUT_WINDOW = 'about'; SettingsCommand = 'desk.settings'; SYSTEM_GROUP = 'system'
|
|
417
|
+
PANEL_LIMITS; SIDEBAR_LIMITS // the windows' sizes (the panel fits its content); Desktop `limits` for those ids overrides
|
|
418
|
+
openAbout(desk) // About as the dock opens it: a centred panel, or forward where it is
|
|
419
|
+
useOpenSettings(): (route?) => void // Settings as the gear opens it (the app's own `open` too); nothing without settings
|
|
420
|
+
appWindowTitle(app, id): string | null // 'Settings' / 'About' for Desk's windows, for a Window menu's title function
|
|
421
|
+
<AboutContent />; <SettingsContent />; aboutText(app, sections): string
|
|
422
|
+
useDeskApp(): DeskApp | null
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
Declared, Desk adds: in the Dock, the gear (when there are settings) and About as the last items of the system
|
|
426
|
+
group (entries after `dockSeparator('system')`; a separator and group of their own when there is none); in the
|
|
427
|
+
MenuBar's app menu (first with `emphasis`, else one is made, named `name`) "About <name>", separator,
|
|
428
|
+
"Settings…" (mod+comma), separator, then the app's items; Desktop draws the `about` and (with `settings` and no `open`) `settings` windows as
|
|
429
|
+
centred panels (sidebar layout: a bigger window with a Sidebar grouped by `group`). Gear, menu and ⌘, focus an
|
|
430
|
+
open panel where it is. ⌘, is bound by the provider on the command, so it works with no MenuBar; the menu item only
|
|
431
|
+
shows it. A `host` menu bar gets the same items through the same publish; the host owns ⌘, while it is up.
|
|
432
|
+
With facts, About has Copy: name + version, then each section's copyable facts. Never put credentials in facts.
|
|
433
|
+
Don't also add your own About/Settings dock or menu items: they would be there twice.
|
|
434
|
+
|
|
368
435
|
### Commands and input
|
|
369
436
|
|
|
370
437
|
```tsx
|
|
@@ -449,7 +516,7 @@ SearchCommand = 'desk.search' // a menu item can open i
|
|
|
449
516
|
// on dark it is the surface lightened and tinted 14% with the accent;
|
|
450
517
|
// --desk-segment-thumb replaces its fill
|
|
451
518
|
// track is 32px tall (26 small), 4 more than a button
|
|
452
|
-
<Tabs tabs={{value,label,badge?,disabled
|
|
519
|
+
<Tabs tabs={{value,label,badge?,disabled?: true | "why"}[]} value onChange label actions?>{selected view}</Tabs>
|
|
453
520
|
// switches the view below; a segmented control chooses
|
|
454
521
|
<Toggle checked onChange label? description? disabled? aria-label? /> // applies at once
|
|
455
522
|
<Checkbox checked indeterminate? onChange label? description? disabled? /> // waits for Save
|
|
@@ -598,7 +665,7 @@ Every value reads a `--desk-*` token; redefine tokens, never override selectors.
|
|
|
598
665
|
`--desk-ok|warn|bad`, `--desk-on-accent`. Spacing `--desk-space-1..7` = 4, 8, 12, 16, 24, 32, 48 px. Also
|
|
599
666
|
`--desk-radius`, `--desk-control-height`, `--desk-control-radius`, `--desk-font`, `--desk-font-mono`,
|
|
600
667
|
`--desk-ease`, `--desk-dock-size`, `--desk-dock-glass`, `--desk-dock-offset`, `--desk-dock-room`,
|
|
601
|
-
`--desk-inset-bottom`, `--desk-wizard-height`, `--desk-field-gap`. Code colours (`CodeBlock`, on `--desk-page`):
|
|
668
|
+
`--desk-widget-width`, `--desk-inset-bottom`, `--desk-wizard-height`, `--desk-field-gap`. Code colours (`CodeBlock`, on `--desk-page`):
|
|
602
669
|
`--desk-code-comment|string|keyword|number|key`, 4.5:1 in light and dark.
|
|
603
670
|
|
|
604
671
|
Light and dark follow `prefers-color-scheme`; `data-theme="light" | "dark"` on the root wins. The look is
|
|
@@ -644,7 +711,7 @@ in the accessibility tree.
|
|
|
644
711
|
- A `DeskProvider` already carries an event bus; `BusProvider` is only for supplying or sharing one.
|
|
645
712
|
- `renderWindow` must be stable (module scope or `useCallback`) for the memoisation to hold.
|
|
646
713
|
- `parse`/`syncWithLocation` warn once when no `isKnown` is given: unknown ids from a URL are then trusted.
|
|
647
|
-
- `npm run size` enforces a gzipped budget: core
|
|
714
|
+
- `npm run size` enforces a gzipped budget: core 17 KiB, react 88 KiB, css 24 KiB, fx 5 KiB.
|
|
648
715
|
- `fx.play` never resumes audio itself: outside a press a browser's resume may never settle. Call
|
|
649
716
|
`fx.unlock()` at startup, or nothing sounds until a press after the sound was due.
|
|
650
717
|
- The package is ESM only, with `"sideEffects": ["**/*.css"]`.
|
package/package.json
CHANGED
package/src/core/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ export type { Bus, DeskEvent, EventHandler, InputDescription, SubscribeOptions }
|
|
|
35
35
|
export { bindShortcuts, formatShortcut, isApplePlatform, isInstalledApp, matchesShortcut, parseShortcut } from './shortcuts.js'
|
|
36
36
|
export type { Keymap, Shortcut, ShortcutOptions } from './shortcuts.js'
|
|
37
37
|
export { deviceLook, lookFor, resolveLook } from './look.js'
|
|
38
|
+
export { COLOR_SCHEME_KEY, COLOR_SCHEME_SCRIPT, LOOK_KEY } from './scheme.js'
|
|
39
|
+
export type { ColorScheme } from './scheme.js'
|
|
38
40
|
export type { Look, LookChoice } from './look.js'
|
|
39
41
|
export { parse, serialize, syncWithLocation } from './location.js'
|
|
40
42
|
export { isTitleCase, titleCase } from './titles.js'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The colour scheme and the look a person chooses in Settings' Appearance, as this browser keeps them. They
|
|
3
|
+
* are here, with no React, for a page's server-rendered `<head>` and for an app moving a choice it kept under
|
|
4
|
+
* a key of its own: write it to these keys once, and Appearance shows and applies it.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Light, dark, or the system's, which the stylesheet follows through `prefers-color-scheme`. */
|
|
8
|
+
export type ColorScheme = 'system' | 'light' | 'dark'
|
|
9
|
+
|
|
10
|
+
/** Where the chosen colour scheme is kept in localStorage: `light` or `dark`; absent for the system's. */
|
|
11
|
+
export const COLOR_SCHEME_KEY = 'desk.scheme'
|
|
12
|
+
|
|
13
|
+
/** Where the chosen look is kept in localStorage: `auto`, `mac`, `gnome` or `windows`; absent while the app's own stands. */
|
|
14
|
+
export const LOOK_KEY = 'desk.look'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* For the page's `<head>`, before anything paints: the remembered scheme on the root as `data-theme`, so a dark
|
|
18
|
+
* choice does not open light for a moment while the app loads.
|
|
19
|
+
*/
|
|
20
|
+
export const COLOR_SCHEME_SCRIPT =
|
|
21
|
+
`try{var s=localStorage.getItem(${JSON.stringify(COLOR_SCHEME_KEY)});if(s=="light"||s=="dark")document.documentElement.setAttribute("data-theme",s)}catch(e){}`
|
package/src/core/types.ts
CHANGED
|
@@ -72,4 +72,10 @@ export interface WindowLimits {
|
|
|
72
72
|
readonly minHeight?: number
|
|
73
73
|
readonly maxWidth?: number
|
|
74
74
|
readonly maxHeight?: number
|
|
75
|
+
/**
|
|
76
|
+
* As tall as its content, up to `maxHeight`, while it sits centred: a short form is not a tall window with
|
|
77
|
+
* room to spare under it. Taller content scrolls inside it as usual. A window dragged or resized free takes
|
|
78
|
+
* the height it is given.
|
|
79
|
+
*/
|
|
80
|
+
readonly fitContent?: boolean
|
|
75
81
|
}
|
package/src/css/apps.css
CHANGED
|
@@ -54,3 +54,152 @@
|
|
|
54
54
|
border: 0;
|
|
55
55
|
background: var(--desk-surface);
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
/* ── About and Settings, from what the app declares ── */
|
|
59
|
+
|
|
60
|
+
.desk-about-body {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: var(--desk-space-4);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.desk-about-brand {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--desk-space-1);
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.desk-about-icon {
|
|
75
|
+
display: grid;
|
|
76
|
+
place-items: center;
|
|
77
|
+
width: 96px;
|
|
78
|
+
height: 96px;
|
|
79
|
+
margin-bottom: var(--desk-space-2);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.desk-about-icon > svg,
|
|
83
|
+
.desk-about-icon > img {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.desk-about-name {
|
|
89
|
+
margin: 0;
|
|
90
|
+
font-size: var(--desk-text-display);
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.desk-about-version,
|
|
95
|
+
.desk-about-description {
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.desk-about-links {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
gap: var(--desk-space-2) var(--desk-space-4);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.desk-about-links a {
|
|
107
|
+
color: var(--desk-accent);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/*
|
|
111
|
+
* Name and value in two columns; a note sits under its value. Every section shares one grid, through
|
|
112
|
+
* subgrid, so the names are one column down the whole panel, as wide as the longest of them.
|
|
113
|
+
*/
|
|
114
|
+
.desk-about-sections {
|
|
115
|
+
display: grid;
|
|
116
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
117
|
+
column-gap: var(--desk-space-3);
|
|
118
|
+
row-gap: var(--desk-space-4);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.desk-about-sections > section {
|
|
122
|
+
grid-column: 1 / -1;
|
|
123
|
+
display: grid;
|
|
124
|
+
grid-template-columns: subgrid;
|
|
125
|
+
/* normal: the panel's column gap, so a section's own gap does not shift its values off the column. */
|
|
126
|
+
column-gap: normal;
|
|
127
|
+
row-gap: var(--desk-space-2);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.desk-about-sections > section > * {
|
|
131
|
+
grid-column: 1 / -1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.desk-about-facts {
|
|
135
|
+
display: grid;
|
|
136
|
+
grid-template-columns: subgrid;
|
|
137
|
+
column-gap: normal;
|
|
138
|
+
row-gap: var(--desk-space-1);
|
|
139
|
+
margin: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* A browser without subgrid: each section is its own grid, and a floor under the names keeps them close. */
|
|
143
|
+
@supports not (grid-template-columns: subgrid) {
|
|
144
|
+
.desk-about-facts {
|
|
145
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
146
|
+
column-gap: var(--desk-space-3);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.desk-about-facts dt {
|
|
150
|
+
min-width: 9rem;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.desk-about-facts > div {
|
|
155
|
+
display: contents;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.desk-about-facts dt {
|
|
159
|
+
color: var(--desk-muted);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.desk-about-facts dd {
|
|
163
|
+
margin: 0;
|
|
164
|
+
overflow-wrap: anywhere;
|
|
165
|
+
user-select: text;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.desk-about-fact-note {
|
|
169
|
+
display: block;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.desk-about-note {
|
|
173
|
+
margin: 0;
|
|
174
|
+
text-align: center;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.desk-about-legal {
|
|
178
|
+
margin: 0;
|
|
179
|
+
text-align: center;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.desk-about-foot {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
gap: var(--desk-space-3);
|
|
186
|
+
padding: var(--desk-space-3) var(--desk-space-4);
|
|
187
|
+
border-top: 1px solid var(--desk-rule);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* What Copy copies, out of sight: selected in place of the panel where there is no clipboard. */
|
|
191
|
+
.desk-about-copied {
|
|
192
|
+
position: absolute;
|
|
193
|
+
width: 1px;
|
|
194
|
+
height: 1px;
|
|
195
|
+
margin: -1px;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
clip-path: inset(50%);
|
|
198
|
+
white-space: pre;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.desk-settings-page {
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
gap: var(--desk-space-5);
|
|
205
|
+
}
|
package/src/css/controls.css
CHANGED
|
@@ -815,7 +815,7 @@
|
|
|
815
815
|
transition: background .12s var(--desk-ease), color .12s var(--desk-ease);
|
|
816
816
|
}
|
|
817
817
|
|
|
818
|
-
.desk-tab:hover:not(:disabled):not([aria-selected="true"]) {
|
|
818
|
+
.desk-tab:hover:not(:disabled):not([aria-disabled="true"]):not([aria-selected="true"]) {
|
|
819
819
|
background: color-mix(in srgb, var(--desk-ink) 6%, transparent);
|
|
820
820
|
color: var(--desk-ink);
|
|
821
821
|
}
|
|
@@ -831,11 +831,30 @@
|
|
|
831
831
|
outline-offset: -2px;
|
|
832
832
|
}
|
|
833
833
|
|
|
834
|
-
.desk-tab:disabled
|
|
834
|
+
.desk-tab:disabled,
|
|
835
|
+
.desk-tab[aria-disabled="true"] {
|
|
835
836
|
opacity: .45;
|
|
836
837
|
cursor: default;
|
|
837
838
|
}
|
|
838
839
|
|
|
840
|
+
/* An unavailable tab the arrows stop on: the ring is drawn in full, the label stays dimmed. */
|
|
841
|
+
.desk-tab[aria-disabled="true"]:focus-visible {
|
|
842
|
+
opacity: 1;
|
|
843
|
+
color: color-mix(in srgb, var(--desk-muted) 45%, transparent);
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/* Why a tab is unavailable: read by a screen reader, shown to a pointer as the tab's title. */
|
|
847
|
+
.desk-tab-why {
|
|
848
|
+
position: absolute;
|
|
849
|
+
width: 1px;
|
|
850
|
+
height: 1px;
|
|
851
|
+
margin: -1px;
|
|
852
|
+
padding: 0;
|
|
853
|
+
overflow: hidden;
|
|
854
|
+
clip-path: inset(50%);
|
|
855
|
+
white-space: nowrap;
|
|
856
|
+
}
|
|
857
|
+
|
|
839
858
|
.desk-tab-badge {
|
|
840
859
|
min-width: 18px;
|
|
841
860
|
padding: 0 5px;
|
package/src/css/dock.css
CHANGED
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
height: 100%;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
/* A dot for "a window is open", brighter when it has focus. */
|
|
223
|
+
/* A dot for "a window is open", brighter when it has focus: a 4px dot 2px off its tile. */
|
|
224
224
|
.desk-dock-item[data-running]::after {
|
|
225
225
|
content: "";
|
|
226
226
|
position: absolute;
|
package/src/css/looks.css
CHANGED
|
@@ -49,11 +49,20 @@
|
|
|
49
49
|
font-size: var(--desk-text-small);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/*
|
|
53
|
-
|
|
52
|
+
/*
|
|
53
|
+
* The end of the bar is the controls', so the (i) is at its start, on the far edge (it is first in the
|
|
54
|
+
* document). It takes the spare room after it, and nothing else in the bar reaches for any: an auto
|
|
55
|
+
* margin on both sides of it would centre it in the room, under the heading.
|
|
56
|
+
*/
|
|
57
|
+
[data-look="gnome"] .desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
58
|
+
margin-left: 0;
|
|
54
59
|
margin-right: auto;
|
|
55
60
|
}
|
|
56
61
|
|
|
62
|
+
[data-look="gnome"] .desk-window-actions {
|
|
63
|
+
margin-left: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
57
66
|
/*
|
|
58
67
|
* The middle is the heading's, so the count waits at the end of the bar, before the controls, and
|
|
59
68
|
* the heading keeps clear of both. A narrow bar keeps the count and lets the track go.
|
|
@@ -61,6 +70,7 @@
|
|
|
61
70
|
[data-look="gnome"] .desk-window-progress {
|
|
62
71
|
position: static;
|
|
63
72
|
transform: none;
|
|
73
|
+
margin-left: 0;
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
[data-look="gnome"] .desk-titlebar[data-progress] .desk-titlebar-heading {
|
|
@@ -138,6 +148,11 @@
|
|
|
138
148
|
height: 5px;
|
|
139
149
|
}
|
|
140
150
|
|
|
151
|
+
/* The (i) is first in the document, at the start of the bar: the end is the controls'. */
|
|
152
|
+
[data-look="windows"] .desk-titlebar > .desk-popover-anchor:has(> .desk-window-info) {
|
|
153
|
+
margin-left: 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
141
156
|
[data-look="windows"] .desk-title {
|
|
142
157
|
flex: 1 1 auto;
|
|
143
158
|
font-size: var(--desk-text-small);
|
|
@@ -190,7 +205,8 @@
|
|
|
190
205
|
* inside them, come out dark too — as the shell's own menus do.
|
|
191
206
|
*/
|
|
192
207
|
[data-look="gnome"] .desk-menubar,
|
|
193
|
-
[data-look="gnome"] .desk-dock
|
|
208
|
+
[data-look="gnome"] .desk-dock,
|
|
209
|
+
[data-look="gnome"] .desk-widget[data-front] {
|
|
194
210
|
--desk-ink: #ffffff;
|
|
195
211
|
--desk-muted: rgb(255 255 255 / 68%);
|
|
196
212
|
--desk-surface: #2a2a2a;
|
|
@@ -225,8 +241,13 @@
|
|
|
225
241
|
color: var(--desk-ink);
|
|
226
242
|
}
|
|
227
243
|
|
|
228
|
-
|
|
244
|
+
/* A widget kept in front is the dash's material too. */
|
|
245
|
+
[data-look="gnome"] .desk-dock,
|
|
246
|
+
[data-look="gnome"] .desk-widget[data-front] {
|
|
229
247
|
--desk-dock-glass: rgb(24 24 24 / 86%);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
[data-look="gnome"] .desk-dock {
|
|
230
251
|
border-radius: 20px;
|
|
231
252
|
}
|
|
232
253
|
|
|
@@ -235,6 +256,31 @@
|
|
|
235
256
|
border-radius: 12px;
|
|
236
257
|
}
|
|
237
258
|
|
|
259
|
+
/*
|
|
260
|
+
* 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
|
|
261
|
+
* 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
|
|
262
|
+
* stands 4px off that, on whichever side the dock is.
|
|
263
|
+
*/
|
|
264
|
+
[data-look="gnome"] .desk-dock {
|
|
265
|
+
--desk-dock-dot-glyph: calc(27% - 8px);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
[data-look="gnome"] .desk-dock .desk-dock-item[data-stack] {
|
|
269
|
+
--desk-dock-dot-glyph: calc(14% - 8px);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
[data-look="gnome"] .desk-dock[data-side="bottom"] .desk-dock-item[data-running]::after {
|
|
273
|
+
bottom: var(--desk-dock-dot-glyph);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
[data-look="gnome"] .desk-dock[data-side="left"] .desk-dock-item[data-running]::after {
|
|
277
|
+
left: var(--desk-dock-dot-glyph);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
[data-look="gnome"] .desk-dock[data-side="right"] .desk-dock-item[data-running]::after {
|
|
281
|
+
right: var(--desk-dock-dot-glyph);
|
|
282
|
+
}
|
|
283
|
+
|
|
238
284
|
/* No magnification: GNOME's dash lights an item up rather than growing it. */
|
|
239
285
|
[data-look="gnome"] .desk-dock .desk-dock-item:hover:not(:disabled),
|
|
240
286
|
[data-look="windows"] .desk-dock .desk-dock-item:hover:not(:disabled) {
|
package/src/css/overlays.css
CHANGED
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
background: var(--desk-surface);
|
|
21
21
|
box-shadow: var(--desk-shadow-floating);
|
|
22
22
|
animation: desk-menu-in .14s var(--desk-ease);
|
|
23
|
+
overscroll-behavior: contain;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Focused only so its keys scroll it (see Popover); the open dialog is its own sign of where focus is. */
|
|
27
|
+
.desk-popover:focus {
|
|
28
|
+
outline: none;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/* A sheet belongs to its window: the scrim covers that window and nothing else. */
|
package/src/css/tokens.css
CHANGED
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
--desk-dock-icon: linear-gradient(160deg, #ffffff, #eceff5);
|
|
85
85
|
--desk-badge: #ef4444;
|
|
86
86
|
--desk-badge-ink: #ffffff;
|
|
87
|
+
--desk-widget-width: 200px;
|
|
87
88
|
/* Room the stage leaves at the bottom for something of the app's own. An overlay dock makes its own. */
|
|
88
89
|
--desk-inset-bottom: 0px;
|
|
89
90
|
}
|