@liberation-data/desk 0.27.0 → 0.29.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 CHANGED
@@ -356,6 +356,22 @@ lamp on white looks switched off. A lamp stays bright on both grounds; on a ligh
356
356
  (`--desk-led-rim`), because the glow that makes it look lit on a dark one (`--desk-led-glow`) has nothing to
357
357
  glow against.
358
358
 
359
+ ## Page dots
360
+
361
+ ```tsx
362
+ import { PageDots } from '@liberation-data/desk/react'
363
+
364
+ <PageDots count={tips.length} value={index} label="Tip" />
365
+ ```
366
+
367
+ Where you are in a short run of pages: a row of dots, the current one drawn longer. It takes less room than
368
+ "3 of 9" and sits in a footer beside the button that moves on. It is a picture, not a control: nothing in
369
+ it is pressed, and the row reads aloud as "Tip 3 of 9", so the dots are never the only thing saying it.
370
+
371
+ It does not grow with the count. Past `max` (default 7) only a window of dots is drawn, around the current
372
+ one, and the dots at an edge with more beyond it shrink — a hundred pages take the room of seven and still
373
+ show which way there is further to go. Fewer than two pages draws nothing.
374
+
359
375
  ## Setup assistant
360
376
 
361
377
  ![A setup assistant on its welcome step](https://raw.githubusercontent.com/liberation-data/desk/main/docs/screenshots/setup.png)
@@ -114,10 +114,15 @@
114
114
 
115
115
  /*
116
116
  * A track with one raised thumb on it. The track is a tint of the ink and the thumb is the surface
117
- * lifted towards white, so the thumb is the lighter of the two on a dark ground and on a light one;
118
- * filled with the surface alone it was the DARKEST thing on a dark ground, and read as a hole.
117
+ * lifted, so the thumb is the lighter of the two on a dark ground and on a light one; filled with
118
+ * the surface alone it was the DARKEST thing on a dark ground, and read as a hole.
119
119
  * No border on either: the shadow is what says raised, and it says it where the fills are close.
120
120
  *
121
+ * On a light ground it is lifted towards white. On a dark one that mix took the hue out and left a
122
+ * grey in no theme, so there the surface's LIGHTNESS is raised in OKLCH, keeping its hue, and a
123
+ * share of the accent is mixed in. On the thumb, not a root token: a host sets --desk-surface on
124
+ * its own wrapper. `--desk-segment-thumb` replaces either fill.
125
+ *
121
126
  * The thumb is as tall as a button and the track is its 2px inset around that.
122
127
  */
123
128
  .desk-segmented {
@@ -134,12 +139,25 @@
134
139
  top: 0;
135
140
  left: 0;
136
141
  border-radius: var(--desk-control-radius);
137
- background: color-mix(in srgb, var(--desk-surface), white 24%);
142
+ background: var(--desk-segment-thumb, color-mix(in srgb, var(--desk-surface), white 24%));
138
143
  box-shadow: 0 1px 3px rgb(0 0 0 / 22%), 0 0 0 .5px rgb(0 0 0 / 10%);
139
144
  transition: transform .22s var(--desk-ease), width .22s var(--desk-ease);
140
145
  pointer-events: none;
141
146
  }
142
147
 
148
+ /* Relative colour is what raises lightness alone. A browser without it keeps the mix above. */
149
+ @supports (color: oklch(from white l c h)) {
150
+ @media (prefers-color-scheme: dark) {
151
+ :root:not([data-theme="light"]) .desk-segment-thumb {
152
+ background: var(--desk-segment-thumb, color-mix(in oklab, oklch(from var(--desk-surface) calc(l + .09) c h), var(--desk-accent) 14%));
153
+ }
154
+ }
155
+
156
+ :root[data-theme="dark"] .desk-segment-thumb {
157
+ background: var(--desk-segment-thumb, color-mix(in oklab, oklch(from var(--desk-surface) calc(l + .09) c h), var(--desk-accent) 14%));
158
+ }
159
+ }
160
+
143
161
  .desk-segment {
144
162
  position: relative;
145
163
  display: inline-flex;
@@ -1224,6 +1242,40 @@
1224
1242
  .desk-led { forced-color-adjust: none; }
1225
1243
  }
1226
1244
 
1245
+ /* PAGE DOTS (`PageDots`): where you are in a run of pages. Ink, not the accent; the why is in pageDots.tsx. */
1246
+ .desk-page-dots {
1247
+ display: inline-flex;
1248
+ align-items: center;
1249
+ vertical-align: middle;
1250
+ }
1251
+
1252
+ .desk-page-dot {
1253
+ flex: none;
1254
+ display: block;
1255
+ width: 6px;
1256
+ height: 6px;
1257
+ margin: 0 3px;
1258
+ border-radius: 3px;
1259
+ background: color-mix(in srgb, var(--desk-ink) 28%, transparent);
1260
+ transition: width 0.2s var(--desk-ease), transform 0.2s var(--desk-ease);
1261
+ }
1262
+
1263
+ .desk-page-dot[data-size="medium"] { transform: scale(0.75); }
1264
+ .desk-page-dot[data-size="small"] { transform: scale(0.5); }
1265
+
1266
+ .desk-page-dot[data-current] {
1267
+ width: 15px;
1268
+ background: var(--desk-ink);
1269
+ }
1270
+
1271
+ @media (prefers-reduced-motion: reduce) {
1272
+ .desk-page-dot { transition: none; }
1273
+ }
1274
+
1275
+ @media (forced-colors: active) {
1276
+ .desk-page-dot[data-current] { background: Highlight; }
1277
+ }
1278
+
1227
1279
  @keyframes desk-spin { to { transform: rotate(360deg); } }
1228
1280
 
1229
1281
  /* A FADE, NOT A FREEZE. §2 Motion asks for movement to go and fades to stay, and a ring that has
package/dist/desk.css CHANGED
@@ -1400,10 +1400,15 @@
1400
1400
 
1401
1401
  /*
1402
1402
  * A track with one raised thumb on it. The track is a tint of the ink and the thumb is the surface
1403
- * lifted towards white, so the thumb is the lighter of the two on a dark ground and on a light one;
1404
- * filled with the surface alone it was the DARKEST thing on a dark ground, and read as a hole.
1403
+ * lifted, so the thumb is the lighter of the two on a dark ground and on a light one; filled with
1404
+ * the surface alone it was the DARKEST thing on a dark ground, and read as a hole.
1405
1405
  * No border on either: the shadow is what says raised, and it says it where the fills are close.
1406
1406
  *
1407
+ * On a light ground it is lifted towards white. On a dark one that mix took the hue out and left a
1408
+ * grey in no theme, so there the surface's LIGHTNESS is raised in OKLCH, keeping its hue, and a
1409
+ * share of the accent is mixed in. On the thumb, not a root token: a host sets --desk-surface on
1410
+ * its own wrapper. `--desk-segment-thumb` replaces either fill.
1411
+ *
1407
1412
  * The thumb is as tall as a button and the track is its 2px inset around that.
1408
1413
  */
1409
1414
  .desk-segmented {
@@ -1420,12 +1425,25 @@
1420
1425
  top: 0;
1421
1426
  left: 0;
1422
1427
  border-radius: var(--desk-control-radius);
1423
- background: color-mix(in srgb, var(--desk-surface), white 24%);
1428
+ background: var(--desk-segment-thumb, color-mix(in srgb, var(--desk-surface), white 24%));
1424
1429
  box-shadow: 0 1px 3px rgb(0 0 0 / 22%), 0 0 0 .5px rgb(0 0 0 / 10%);
1425
1430
  transition: transform .22s var(--desk-ease), width .22s var(--desk-ease);
1426
1431
  pointer-events: none;
1427
1432
  }
1428
1433
 
1434
+ /* Relative colour is what raises lightness alone. A browser without it keeps the mix above. */
1435
+ @supports (color: oklch(from white l c h)) {
1436
+ @media (prefers-color-scheme: dark) {
1437
+ :root:not([data-theme="light"]) .desk-segment-thumb {
1438
+ background: var(--desk-segment-thumb, color-mix(in oklab, oklch(from var(--desk-surface) calc(l + .09) c h), var(--desk-accent) 14%));
1439
+ }
1440
+ }
1441
+
1442
+ :root[data-theme="dark"] .desk-segment-thumb {
1443
+ background: var(--desk-segment-thumb, color-mix(in oklab, oklch(from var(--desk-surface) calc(l + .09) c h), var(--desk-accent) 14%));
1444
+ }
1445
+ }
1446
+
1429
1447
  .desk-segment {
1430
1448
  position: relative;
1431
1449
  display: inline-flex;
@@ -2510,6 +2528,40 @@
2510
2528
  .desk-led { forced-color-adjust: none; }
2511
2529
  }
2512
2530
 
2531
+ /* PAGE DOTS (`PageDots`): where you are in a run of pages. Ink, not the accent; the why is in pageDots.tsx. */
2532
+ .desk-page-dots {
2533
+ display: inline-flex;
2534
+ align-items: center;
2535
+ vertical-align: middle;
2536
+ }
2537
+
2538
+ .desk-page-dot {
2539
+ flex: none;
2540
+ display: block;
2541
+ width: 6px;
2542
+ height: 6px;
2543
+ margin: 0 3px;
2544
+ border-radius: 3px;
2545
+ background: color-mix(in srgb, var(--desk-ink) 28%, transparent);
2546
+ transition: width 0.2s var(--desk-ease), transform 0.2s var(--desk-ease);
2547
+ }
2548
+
2549
+ .desk-page-dot[data-size="medium"] { transform: scale(0.75); }
2550
+ .desk-page-dot[data-size="small"] { transform: scale(0.5); }
2551
+
2552
+ .desk-page-dot[data-current] {
2553
+ width: 15px;
2554
+ background: var(--desk-ink);
2555
+ }
2556
+
2557
+ @media (prefers-reduced-motion: reduce) {
2558
+ .desk-page-dot { transition: none; }
2559
+ }
2560
+
2561
+ @media (forced-colors: active) {
2562
+ .desk-page-dot[data-current] { background: Highlight; }
2563
+ }
2564
+
2513
2565
  @keyframes desk-spin { to { transform: rotate(360deg); } }
2514
2566
 
2515
2567
  /* A FADE, NOT A FREEZE. §2 Motion asks for movement to go and fades to stay, and a ring that has
@@ -25,6 +25,8 @@ export { useWindowInfo, useWindowNote } from './windowDescription.js';
25
25
  export type { WindowDescription } from './windowDescription.js';
26
26
  export type { LoadingProps, SpinnerProps, SpinnerSize } from './progress.js';
27
27
  export { Led } from './led.js';
28
+ export { PageDots, pageWindow } from './pageDots.js';
29
+ export type { PageDot, PageDotsProps } from './pageDots.js';
28
30
  export type { LedColor, LedProps } from './led.js';
29
31
  export { Pane, PaneHeader, Section, Toolbar } from './pane.js';
30
32
  export type { PaneHeaderProps, PaneProps, SectionProps, ToolbarProps } from './pane.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC1E,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAChG,YAAY,EACV,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACxF,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACr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aAAa,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC/E,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
@@ -12,6 +12,7 @@ export { Loading, Spinner } from './progress.js';
12
12
  export { useWindowProgress } from './windowProgress.js';
13
13
  export { useWindowInfo, useWindowNote } from './windowDescription.js';
14
14
  export { Led } from './led.js';
15
+ export { PageDots, pageWindow } from './pageDots.js';
15
16
  export { Pane, PaneHeader, Section, Toolbar } from './pane.js';
16
17
  export { InfoTip } from './infoTip.js';
17
18
  export { Checklist, useTasks } from './tasks.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE1E,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAWhG,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAExF,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE,MA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AO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
@@ -0,0 +1,20 @@
1
+ export interface PageDotsProps {
2
+ /** How many pages there are. Nothing is drawn for fewer than two. */
3
+ readonly count: number;
4
+ /** The current page, from 0. */
5
+ readonly value: number;
6
+ /** What a page is, in a word: "Tip", "Photo". Read aloud with the position. */
7
+ readonly label: string;
8
+ /** The most dots drawn at once. Default 7; an odd number keeps the current one in the middle. */
9
+ readonly max?: number;
10
+ readonly className?: string;
11
+ }
12
+ export interface PageDot {
13
+ readonly index: number;
14
+ /** Smaller toward an edge that has more pages beyond it. */
15
+ readonly size: 'full' | 'medium' | 'small';
16
+ }
17
+ /** The dots to draw for [count] pages at [value]: all of them, or a window of [max] around it. */
18
+ export declare function pageWindow(count: number, value: number, max?: number): PageDot[];
19
+ export declare function PageDots({ count, value, label, max, className }: PageDotsProps): import("react").JSX.Element | null;
20
+ //# sourceMappingURL=pageDots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageDots.d.ts","sourceRoot":"","sources":["../../src/react/pageDots.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,iGAAiG;IACjG,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;CAC3C;AAED,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,OAAO,EAAE,CAU3E;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAO,EAAE,SAAS,EAAE,EAAE,aAAa,sCAUlF"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /** The dots to draw for [count] pages at [value]: all of them, or a window of [max] around it. */
3
+ export function pageWindow(count, value, max = 7) {
4
+ const shown = Math.max(1, Math.min(max, count));
5
+ const at = Math.min(Math.max(value, 0), Math.max(count - 1, 0));
6
+ const start = Math.min(Math.max(at - Math.floor(shown / 2), 0), Math.max(count - shown, 0));
7
+ const before = start > 0;
8
+ const after = start + shown < count;
9
+ return Array.from({ length: shown }, (_, i) => {
10
+ const fromEdge = Math.min(before ? i : Infinity, after ? shown - 1 - i : Infinity);
11
+ return { index: start + i, size: fromEdge === 0 ? 'small' : fromEdge === 1 ? 'medium' : 'full' };
12
+ });
13
+ }
14
+ export function PageDots({ count, value, label, max = 7, className }) {
15
+ if (count < 2)
16
+ return null;
17
+ const at = Math.min(Math.max(value, 0), count - 1);
18
+ return (_jsx("span", { className: ['desk-page-dots', className].filter(Boolean).join(' '), role: "img", "aria-label": `${label} ${at + 1} of ${count}`, children: pageWindow(count, at, max).map(dot => (_jsx("span", { className: "desk-page-dot", "data-size": dot.size, "data-current": dot.index === at || undefined }, dot.index))) }));
19
+ }
20
+ //# sourceMappingURL=pageDots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageDots.js","sourceRoot":"","sources":["../../src/react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,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;IAClG,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,EAAE,SAAS,EAAiB;IACjF,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,IAAI,CAAA;IAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;IAClD,OAAO,CACL,eAAM,SAAS,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAC,KAAK,gBAAa,GAAG,KAAK,IAAI,EAAE,GAAG,CAAC,OAAO,KAAK,EAAE,YAC9H,UAAU,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CACrC,eAAsB,SAAS,EAAC,eAAe,eAAY,GAAG,CAAC,IAAI,kBAAgB,GAAG,CAAC,KAAK,KAAK,EAAE,IAAI,SAAS,IAArG,GAAG,CAAC,KAAK,CAAgG,CACrH,CAAC,GACG,CACR,CAAA;AACH,CAAC"}
package/llms.txt CHANGED
@@ -384,6 +384,8 @@ SearchCommand = 'desk.search' // a menu item can open i
384
384
  <Button intent?={'normal'|'default'|'quiet'|'destructive'} size?={'regular'|'small'} icon? … />
385
385
  <SegmentedControl options={{value,label,icon?,disabled?}[]} value onChange label size? disabled? width?={fit|fill} />
386
386
  // selection is one sliding `.desk-segment-thumb`, not a fill on the option;
387
+ // on dark it is the surface lightened and tinted 14% with the accent;
388
+ // --desk-segment-thumb replaces its fill
387
389
  // track is 32px tall (26 small), 4 more than a button
388
390
  <Tabs tabs={{value,label,badge?,disabled?}[]} value onChange label actions?>{selected view}</Tabs>
389
391
  // switches the view below; a segmented control chooses
@@ -419,6 +421,17 @@ The colour is named for what it looks like; what it means is the app's to say, i
419
421
  never the only thing carrying a state. Its colours are `--desk-led-*`, bright on both grounds, not the
420
422
  `--desk-ok`/`--desk-warn`/`--desk-bad` text tokens, which are dark on a light ground and look switched off.
421
423
 
424
+ ### Page dots
425
+
426
+ ```tsx
427
+ <PageDots count value label={'Tip'} max?={7} className? /> // value from 0; read aloud as "Tip 3 of 9"
428
+ pageWindow(count, value, max?): { index, size: 'full'|'medium'|'small' }[] // the dots it draws
429
+ ```
430
+
431
+ Position in a short run of pages. Past `max` it draws a window around the current dot and shrinks the dots
432
+ at an edge with more beyond it, so the row never grows. It is `role="img"` and takes no focus: a button
433
+ beside it moves between pages. Fewer than two pages draws nothing.
434
+
422
435
  Both are one `role="status"`. `Loading` shows `slow` once the wait passes `slowAfterMs`, inside that same
423
436
  region, so its arrival is the announcement; the timer restarts when `slow` or `slowAfterMs` changes. There
424
437
  is no determinate bar: a bar needs a fraction the browser can see, and work with real steps is a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liberation-data/desk",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "A desktop for the web, for React: windows, a dock, menus and commands, controls, tours and setup assistants.",
5
5
  "keywords": [
6
6
  "react",
@@ -113,10 +113,15 @@
113
113
 
114
114
  /*
115
115
  * A track with one raised thumb on it. The track is a tint of the ink and the thumb is the surface
116
- * lifted towards white, so the thumb is the lighter of the two on a dark ground and on a light one;
117
- * filled with the surface alone it was the DARKEST thing on a dark ground, and read as a hole.
116
+ * lifted, so the thumb is the lighter of the two on a dark ground and on a light one; filled with
117
+ * the surface alone it was the DARKEST thing on a dark ground, and read as a hole.
118
118
  * No border on either: the shadow is what says raised, and it says it where the fills are close.
119
119
  *
120
+ * On a light ground it is lifted towards white. On a dark one that mix took the hue out and left a
121
+ * grey in no theme, so there the surface's LIGHTNESS is raised in OKLCH, keeping its hue, and a
122
+ * share of the accent is mixed in. On the thumb, not a root token: a host sets --desk-surface on
123
+ * its own wrapper. `--desk-segment-thumb` replaces either fill.
124
+ *
120
125
  * The thumb is as tall as a button and the track is its 2px inset around that.
121
126
  */
122
127
  .desk-segmented {
@@ -133,12 +138,25 @@
133
138
  top: 0;
134
139
  left: 0;
135
140
  border-radius: var(--desk-control-radius);
136
- background: color-mix(in srgb, var(--desk-surface), white 24%);
141
+ background: var(--desk-segment-thumb, color-mix(in srgb, var(--desk-surface), white 24%));
137
142
  box-shadow: 0 1px 3px rgb(0 0 0 / 22%), 0 0 0 .5px rgb(0 0 0 / 10%);
138
143
  transition: transform .22s var(--desk-ease), width .22s var(--desk-ease);
139
144
  pointer-events: none;
140
145
  }
141
146
 
147
+ /* Relative colour is what raises lightness alone. A browser without it keeps the mix above. */
148
+ @supports (color: oklch(from white l c h)) {
149
+ @media (prefers-color-scheme: dark) {
150
+ :root:not([data-theme="light"]) .desk-segment-thumb {
151
+ background: var(--desk-segment-thumb, color-mix(in oklab, oklch(from var(--desk-surface) calc(l + .09) c h), var(--desk-accent) 14%));
152
+ }
153
+ }
154
+
155
+ :root[data-theme="dark"] .desk-segment-thumb {
156
+ background: var(--desk-segment-thumb, color-mix(in oklab, oklch(from var(--desk-surface) calc(l + .09) c h), var(--desk-accent) 14%));
157
+ }
158
+ }
159
+
142
160
  .desk-segment {
143
161
  position: relative;
144
162
  display: inline-flex;
@@ -1223,6 +1241,40 @@
1223
1241
  .desk-led { forced-color-adjust: none; }
1224
1242
  }
1225
1243
 
1244
+ /* PAGE DOTS (`PageDots`): where you are in a run of pages. Ink, not the accent; the why is in pageDots.tsx. */
1245
+ .desk-page-dots {
1246
+ display: inline-flex;
1247
+ align-items: center;
1248
+ vertical-align: middle;
1249
+ }
1250
+
1251
+ .desk-page-dot {
1252
+ flex: none;
1253
+ display: block;
1254
+ width: 6px;
1255
+ height: 6px;
1256
+ margin: 0 3px;
1257
+ border-radius: 3px;
1258
+ background: color-mix(in srgb, var(--desk-ink) 28%, transparent);
1259
+ transition: width 0.2s var(--desk-ease), transform 0.2s var(--desk-ease);
1260
+ }
1261
+
1262
+ .desk-page-dot[data-size="medium"] { transform: scale(0.75); }
1263
+ .desk-page-dot[data-size="small"] { transform: scale(0.5); }
1264
+
1265
+ .desk-page-dot[data-current] {
1266
+ width: 15px;
1267
+ background: var(--desk-ink);
1268
+ }
1269
+
1270
+ @media (prefers-reduced-motion: reduce) {
1271
+ .desk-page-dot { transition: none; }
1272
+ }
1273
+
1274
+ @media (forced-colors: active) {
1275
+ .desk-page-dot[data-current] { background: Highlight; }
1276
+ }
1277
+
1226
1278
  @keyframes desk-spin { to { transform: rotate(360deg); } }
1227
1279
 
1228
1280
  /* A FADE, NOT A FREEZE. §2 Motion asks for movement to go and fades to stay, and a ring that has
@@ -47,6 +47,8 @@ export { useWindowInfo, useWindowNote } from './windowDescription.js'
47
47
  export type { WindowDescription } from './windowDescription.js'
48
48
  export type { LoadingProps, SpinnerProps, SpinnerSize } from './progress.js'
49
49
  export { Led } from './led.js'
50
+ export { PageDots, pageWindow } from './pageDots.js'
51
+ export type { PageDot, PageDotsProps } from './pageDots.js'
50
52
  export type { LedColor, LedProps } from './led.js'
51
53
  export { Pane, PaneHeader, Section, Toolbar } from './pane.js'
52
54
  export type { PaneHeaderProps, PaneProps, SectionProps, ToolbarProps } from './pane.js'
@@ -0,0 +1,60 @@
1
+ /*
2
+ * WHERE YOU ARE IN A SHORT RUN OF PAGES.
3
+ *
4
+ * A row of dots, the current one drawn longer: tips, a gallery, the screens of a walkthrough. It
5
+ * says position at a glance and takes less room than "3 of 9", which is why it sits in a footer
6
+ * beside the button that moves on.
7
+ *
8
+ * IT DOES NOT GROW WITH THE COUNT. Nine dots are nine dots; a hundred would be a ruler. Past
9
+ * `max` only a window of them is drawn, around the current one, and the dots at an edge with more
10
+ * beyond it shrink — so the row keeps its width and still shows which way there is further to go.
11
+ *
12
+ * THE DOTS ARE NEVER THE ONLY THING THAT SAYS IT. The row reads aloud as "<label> 12 of 100", the
13
+ * exact position a row of seven dots cannot show.
14
+ *
15
+ * A PICTURE, NOT A CONTROL. A dot is six pixels and a page is pressed for with a button; dots that
16
+ * could be pressed would each need a 44 px target, and then they are no longer a row of dots.
17
+ */
18
+
19
+ export interface PageDotsProps {
20
+ /** How many pages there are. Nothing is drawn for fewer than two. */
21
+ readonly count: number
22
+ /** The current page, from 0. */
23
+ readonly value: number
24
+ /** What a page is, in a word: "Tip", "Photo". Read aloud with the position. */
25
+ readonly label: string
26
+ /** The most dots drawn at once. Default 7; an odd number keeps the current one in the middle. */
27
+ readonly max?: number
28
+ readonly className?: string
29
+ }
30
+
31
+ export interface PageDot {
32
+ readonly index: number
33
+ /** Smaller toward an edge that has more pages beyond it. */
34
+ readonly size: 'full' | 'medium' | 'small'
35
+ }
36
+
37
+ /** The dots to draw for [count] pages at [value]: all of them, or a window of [max] around it. */
38
+ export function pageWindow(count: number, value: number, max = 7): PageDot[] {
39
+ const shown = Math.max(1, Math.min(max, count))
40
+ const at = Math.min(Math.max(value, 0), Math.max(count - 1, 0))
41
+ const start = Math.min(Math.max(at - Math.floor(shown / 2), 0), Math.max(count - shown, 0))
42
+ const before = start > 0
43
+ const after = start + shown < count
44
+ return Array.from({ length: shown }, (_, i): PageDot => {
45
+ const fromEdge = Math.min(before ? i : Infinity, after ? shown - 1 - i : Infinity)
46
+ return { index: start + i, size: fromEdge === 0 ? 'small' : fromEdge === 1 ? 'medium' : 'full' }
47
+ })
48
+ }
49
+
50
+ export function PageDots({ count, value, label, max = 7, className }: PageDotsProps) {
51
+ if (count < 2) return null
52
+ const at = Math.min(Math.max(value, 0), count - 1)
53
+ return (
54
+ <span className={['desk-page-dots', className].filter(Boolean).join(' ')} role="img" aria-label={`${label} ${at + 1} of ${count}`}>
55
+ {pageWindow(count, at, max).map(dot => (
56
+ <span key={dot.index} className="desk-page-dot" data-size={dot.size} data-current={dot.index === at || undefined} />
57
+ ))}
58
+ </span>
59
+ )
60
+ }