@bigpixelrocket/uiok 0.4.0 → 0.6.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.
Files changed (122) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/dist/button/TextLink.d.ts +26 -3
  3. package/dist/button/TextLink.js +5 -3
  4. package/dist/button/button.css +7 -0
  5. package/dist/dialog/ModalDialog.js +8 -2
  6. package/dist/dialog/SectionedDialog.d.ts +37 -0
  7. package/dist/dialog/SectionedDialog.js +157 -0
  8. package/dist/dialog/dialog.css +102 -0
  9. package/dist/dialog/index.d.ts +4 -2
  10. package/dist/dialog/index.js +4 -2
  11. package/dist/frame/AppRoot.d.ts +1 -1
  12. package/dist/frame/AppRoot.js +2 -1
  13. package/dist/frame/Dock.d.ts +1 -1
  14. package/dist/frame/Dock.js +2 -1
  15. package/dist/frame/FilterChips.d.ts +5 -2
  16. package/dist/frame/FilterChips.js +35 -2
  17. package/dist/frame/FilterChips.logic.d.ts +24 -0
  18. package/dist/frame/FilterChips.logic.js +34 -0
  19. package/dist/frame/PageParts.d.ts +4 -3
  20. package/dist/frame/PageParts.js +10 -3
  21. package/dist/frame/SideBySide.d.ts +32 -0
  22. package/dist/frame/SideBySide.js +50 -0
  23. package/dist/frame/Tree.d.ts +9 -3
  24. package/dist/frame/Tree.js +8 -5
  25. package/dist/frame/WindowFrame.d.ts +1 -1
  26. package/dist/frame/WindowFrame.js +3 -1
  27. package/dist/frame/frame.css +74 -5
  28. package/dist/frame/index.d.ts +4 -2
  29. package/dist/frame/index.js +4 -2
  30. package/dist/grid/grid.css +1 -0
  31. package/dist/icon/ProductMark.d.ts +57 -0
  32. package/dist/icon/ProductMark.js +26 -0
  33. package/dist/icon/icon.css +53 -0
  34. package/dist/icon/index.d.ts +3 -1
  35. package/dist/icon/index.js +3 -1
  36. package/dist/keyboard/Keyboard.logic.js +20 -3
  37. package/dist/keychord/KeyChord.d.ts +17 -1
  38. package/dist/keychord/KeyChord.js +16 -1
  39. package/dist/keychord/ShortcutIndex.d.ts +49 -0
  40. package/dist/keychord/ShortcutIndex.js +28 -0
  41. package/dist/keychord/index.d.ts +8 -2
  42. package/dist/keychord/index.js +8 -2
  43. package/dist/keychord/keychord.css +101 -0
  44. package/dist/labels/dialog.d.ts +2 -0
  45. package/dist/labels/dialog.js +2 -1
  46. package/dist/labels/keys.d.ts +5 -0
  47. package/dist/labels/keys.js +2 -1
  48. package/dist/labels/settings.d.ts +6 -0
  49. package/dist/labels/settings.js +1 -0
  50. package/dist/listing/Listing.d.ts +95 -7
  51. package/dist/listing/Listing.js +57 -13
  52. package/dist/listing/ListingScope.d.ts +7 -0
  53. package/dist/listing/ListingScope.js +8 -0
  54. package/dist/listing/PaneMessage.d.ts +7 -4
  55. package/dist/listing/PaneMessage.js +11 -4
  56. package/dist/listing/Timeline.d.ts +51 -0
  57. package/dist/listing/Timeline.js +28 -0
  58. package/dist/listing/index.d.ts +4 -2
  59. package/dist/listing/index.js +3 -1
  60. package/dist/listing/listing.css +268 -25
  61. package/dist/log/Ansi.logic.d.ts +27 -0
  62. package/dist/log/Ansi.logic.js +203 -0
  63. package/dist/log/LogWell.d.ts +11 -2
  64. package/dist/log/LogWell.js +15 -3
  65. package/dist/log/index.d.ts +1 -0
  66. package/dist/log/index.js +1 -0
  67. package/dist/log/log.css +80 -0
  68. package/dist/menu/Menu.d.ts +133 -0
  69. package/dist/menu/Menu.js +351 -0
  70. package/dist/menu/Menu.logic.d.ts +83 -0
  71. package/dist/menu/Menu.logic.js +92 -0
  72. package/dist/menu/index.d.ts +6 -1
  73. package/dist/menu/index.js +6 -1
  74. package/dist/menu/menu.css +57 -0
  75. package/dist/palette/Palette.d.ts +3 -2
  76. package/dist/palette/Palette.js +8 -4
  77. package/dist/palette/PaletteRows.d.ts +138 -0
  78. package/dist/palette/PaletteRows.js +76 -0
  79. package/dist/palette/index.d.ts +5 -2
  80. package/dist/palette/index.js +5 -2
  81. package/dist/pane/Pane.d.ts +42 -6
  82. package/dist/pane/Pane.js +92 -5
  83. package/dist/pane/PaneFrame.d.ts +22 -1
  84. package/dist/pane/PaneFrame.js +42 -5
  85. package/dist/pane/PaneKeys.d.ts +5 -1
  86. package/dist/pane/PaneKeys.js +28 -3
  87. package/dist/pane/PaneKeys.logic.d.ts +25 -0
  88. package/dist/pane/PaneKeys.logic.js +30 -0
  89. package/dist/pane/index.d.ts +2 -2
  90. package/dist/pane/index.js +1 -1
  91. package/dist/pane/usePaneKeys.d.ts +8 -1
  92. package/dist/pane/usePaneKeys.js +32 -12
  93. package/dist/shell/SettingsDialog.d.ts +20 -2
  94. package/dist/shell/SettingsDialog.js +13 -3
  95. package/dist/shell/index.d.ts +1 -1
  96. package/dist/styles.css +18 -3
  97. package/dist/surface/FactList.d.ts +54 -0
  98. package/dist/surface/FactList.js +33 -0
  99. package/dist/surface/FactTable.d.ts +44 -0
  100. package/dist/surface/FactTable.js +33 -0
  101. package/dist/surface/index.d.ts +7 -2
  102. package/dist/surface/index.js +7 -2
  103. package/dist/surface/surface.css +139 -2
  104. package/dist/tabs/PageTabs.d.ts +6 -0
  105. package/dist/tabs/PageTabs.js +1 -1
  106. package/dist/tabs/tabs.css +14 -0
  107. package/dist/terminal/TerminalBox.d.ts +30 -0
  108. package/dist/terminal/TerminalBox.js +17 -0
  109. package/dist/terminal/ghostty/core.d.ts +12 -4
  110. package/dist/terminal/ghostty/core.js +12 -4
  111. package/dist/terminal/index.d.ts +6 -2
  112. package/dist/terminal/index.js +6 -2
  113. package/dist/terminal/terminal.css +29 -0
  114. package/dist/text/Code.d.ts +15 -0
  115. package/dist/text/Code.js +12 -0
  116. package/dist/text/index.d.ts +6 -1
  117. package/dist/text/index.js +6 -1
  118. package/dist/text/text.css +21 -0
  119. package/dist/themes/themes.generated.css +20 -0
  120. package/dist/themes/tokens.d.ts +1 -0
  121. package/dist/themes/tokens.js +16 -2
  122. package/package.json +1 -1
@@ -5,6 +5,7 @@
5
5
  * panes say what they offer by these marks, so the keys run exactly what a
6
6
  * click would, disabled where the control is.
7
7
  */
8
+ import { listingFirstStop } from './PaneKeys.logic.js';
8
9
  /**
9
10
  * The elements in `root` matching `selector` that show: none inside a
10
11
  * `hidden` element under `root`, such as a page held mounted out of sight
@@ -42,12 +43,17 @@ export function verbControl(root, verb, attribute = 'verb') {
42
43
  const FOCUSABLE = 'a[href], button, input, select, textarea, summary, [tabindex]';
43
44
  /**
44
45
  * Whether Tab would stop on an element: focusable, not taken out of the
45
- * order, not disabled, not hidden or inert, not inside a closed disclosure
46
+ * order, not disabled, not a hidden input, not hidden or inert, not inside a closed disclosure
46
47
  * (its summary aside), and, of a radio group, only its checked radio, or
47
48
  * its first while none is.
48
49
  */
49
50
  function tabbable(element) {
50
- if (element.tabIndex < 0 || element.disabled)
51
+ // `:disabled` also covers a control inside a disabled fieldset, which
52
+ // refuses the focus though its own `disabled` is false.
53
+ if (element.tabIndex < 0 || element.matches(':disabled'))
54
+ return false;
55
+ // A hidden input is never drawn, so it never takes the focus, whatever its tabindex.
56
+ if (element instanceof HTMLInputElement && element.type === 'hidden')
51
57
  return false;
52
58
  if (element.closest('[hidden], [inert], [aria-hidden="true"]') !== null)
53
59
  return false;
@@ -81,8 +87,27 @@ const inDocumentOrder = (a, b) => a.compareDocumentPosition(b) & Node.DOCUMENT_P
81
87
  * its listing keeps them in the Tab order (`Row`'s `tabbable`); a sidebar
82
88
  * row's never are. With `alone` (no sidebar shown) the page's stops make
83
89
  * the one cycle, wrapping at either end, and the sidebar is never named.
90
+ * With `order` `listing`, each pane's listing comes first instead of where
91
+ * the document puts it (`listingFirstStop`): the page's listing, its other
92
+ * stops, then the sidebar's listing and, with `sidebar`, its stops.
84
93
  */
85
- export function nextTabStop(main, home, from, back, sidebar = null, alone = false) {
94
+ export function nextTabStop(main, home, from, back, sidebar = null, alone = false, order = 'document') {
95
+ if (order === 'listing') {
96
+ const page = {
97
+ home: 'page',
98
+ stops: tabStops(main).filter((stop) => stop !== home)
99
+ };
100
+ const side = alone
101
+ ? null
102
+ : {
103
+ home: 'sidebar',
104
+ stops: sidebar === null
105
+ ? []
106
+ : tabStops(sidebar.pane).filter((stop) => stop !== sidebar.home && stop.closest('[data-row-key]') === null)
107
+ };
108
+ const at = from === home ? 'page' : sidebar !== null && from === sidebar.home ? 'sidebar' : from;
109
+ return listingFirstStop(page, side, at, back);
110
+ }
86
111
  if (from === 'sidebar' && sidebar === null)
87
112
  return 'page';
88
113
  const at = from === 'sidebar' ? (sidebar?.home ?? home) : from === 'page' ? home : from;
@@ -93,3 +93,28 @@ export declare const NO_MAIN_VERBS: MainVerbs;
93
93
  * so a reading that changed nothing keeps the one a legend drew.
94
94
  */
95
95
  export declare const sameVerbs: <Verbs extends object>(a: Verbs, b: Verbs) => boolean;
96
+ /**
97
+ * The order Tab walks a two-pane window in: `document`, every stop where
98
+ * the document puts it, each pane's listing among them; `listing`, each
99
+ * pane's listing first, then its other stops in document order, as a file
100
+ * manager walks its panes (`listingFirstStop`).
101
+ */
102
+ export type TabOrder = 'document' | 'listing';
103
+ /** One pane as a listing-first walk sees it: its listing (its home) and its other stops in document order. */
104
+ export interface WalkPane<Stop> {
105
+ readonly home: Stop;
106
+ /** The pane's Tab stops in document order, its home left out. */
107
+ readonly stops: readonly Stop[];
108
+ }
109
+ /**
110
+ * Where Tab (Shift-Tab with `back`) goes from `from` in a listing-first
111
+ * walk: from the page's listing through the page's other stops in document
112
+ * order, then to the sidebar's listing and through its stops, then back to
113
+ * the page's listing. Shift-Tab steps back through a pane's stops to its
114
+ * listing, and from a listing switches panes to the other one's listing.
115
+ * Without a sidebar (none shown), the page's listing and stops make one
116
+ * cycle that wraps at either end. A `from` neither pane holds (the window
117
+ * itself, a row's control) goes on as from the page's listing. Pure over
118
+ * whatever stands for a stop, so the rule is tested without a DOM.
119
+ */
120
+ export declare function listingFirstStop<Stop>(page: WalkPane<Stop>, sidebar: WalkPane<Stop> | null, from: Stop | null, back: boolean): Stop;
@@ -107,3 +107,33 @@ export const NO_MAIN_VERBS = {
107
107
  */
108
108
  export const sameVerbs = (a, b) => Object.keys(a).every((field) => a[field] === b[field]) &&
109
109
  Object.keys(b).length === Object.keys(a).length;
110
+ /**
111
+ * Where Tab (Shift-Tab with `back`) goes from `from` in a listing-first
112
+ * walk: from the page's listing through the page's other stops in document
113
+ * order, then to the sidebar's listing and through its stops, then back to
114
+ * the page's listing. Shift-Tab steps back through a pane's stops to its
115
+ * listing, and from a listing switches panes to the other one's listing.
116
+ * Without a sidebar (none shown), the page's listing and stops make one
117
+ * cycle that wraps at either end. A `from` neither pane holds (the window
118
+ * itself, a row's control) goes on as from the page's listing. Pure over
119
+ * whatever stands for a stop, so the rule is tested without a DOM.
120
+ */
121
+ export function listingFirstStop(page, sidebar, from, back) {
122
+ if (sidebar !== null && from !== null) {
123
+ const at = from === sidebar.home ? -1 : sidebar.stops.indexOf(from);
124
+ if (from === sidebar.home || at >= 0) {
125
+ if (!back)
126
+ return sidebar.stops[at + 1] ?? page.home;
127
+ if (at === -1)
128
+ return page.home;
129
+ return at === 0 ? sidebar.home : (sidebar.stops[at - 1] ?? sidebar.home);
130
+ }
131
+ }
132
+ const at = from === null ? -1 : page.stops.indexOf(from);
133
+ if (back) {
134
+ if (at === -1)
135
+ return sidebar?.home ?? page.stops.at(-1) ?? page.home;
136
+ return at === 0 ? page.home : (page.stops[at - 1] ?? page.home);
137
+ }
138
+ return page.stops[at + 1] ?? sidebar?.home ?? page.home;
139
+ }
@@ -10,9 +10,9 @@
10
10
  */
11
11
  export { PaneBox, PaneList, type PaneBoxProps, type PaneListProps, type RegionHandlers } from './Pane.js';
12
12
  export { InRowContext, QuietAction, RowIconAction, RowLinkLookContext, useInRow, type ControlVerb, type LinkLook, type QuietActionProps, type RowIconActionProps } from './PaneActions.js';
13
- export { PanePathBar, PaneStatus, PathFact, type PaneCrumb, type PanePathBarProps, type PaneStatusProps, type PathFactProps } from './PaneFrame.js';
13
+ export { PanePathBar, PaneStatus, PathFact, type PaneCrumb, type PaneSiblings, type PanePathBarProps, type PaneStatusProps, type PathFactProps } from './PaneFrame.js';
14
14
  export { isTabStop, nextTabStop, pageRows, paneRow, paneRows, showRow, tabStops, verbControl, type SidebarTabStops, type TabStop } from './PaneKeys.js';
15
- export { movedIndex, NO_MAIN_VERBS, paneKeyAction, sameVerbs, type MainVerbs, type PaneKeyAction, type PaneKeyOptions, type PaneKeyStroke, type PaneMove } from './PaneKeys.logic.js';
15
+ export { listingFirstStop, movedIndex, NO_MAIN_VERBS, paneKeyAction, sameVerbs, type MainVerbs, type PaneKeyAction, type PaneKeyOptions, type PaneKeyStroke, type TabOrder, type WalkPane, type PaneMove } from './PaneKeys.logic.js';
16
16
  export { PaneTabs, type PaneTabItem, type PaneTabsProps } from './PaneTabs.js';
17
17
  export { draggedTabOrder, foldOrder, foldsNeeded, gatherTabs, pickedTabs, pickRun, tabLabelFloor, togglePick, type FoldableTab, type TabBox, type TabPicks } from './PaneTabs.logic.js';
18
18
  export { useToolbarFit } from './useToolbarFit.js';
@@ -12,7 +12,7 @@ export { PaneBox, PaneList } from './Pane.js';
12
12
  export { InRowContext, QuietAction, RowIconAction, RowLinkLookContext, useInRow } from './PaneActions.js';
13
13
  export { PanePathBar, PaneStatus, PathFact } from './PaneFrame.js';
14
14
  export { isTabStop, nextTabStop, pageRows, paneRow, paneRows, showRow, tabStops, verbControl } from './PaneKeys.js';
15
- export { movedIndex, NO_MAIN_VERBS, paneKeyAction, sameVerbs } from './PaneKeys.logic.js';
15
+ export { listingFirstStop, movedIndex, NO_MAIN_VERBS, paneKeyAction, sameVerbs } from './PaneKeys.logic.js';
16
16
  export { PaneTabs } from './PaneTabs.js';
17
17
  export { draggedTabOrder, foldOrder, foldsNeeded, gatherTabs, pickedTabs, pickRun, tabLabelFloor, togglePick } from './PaneTabs.logic.js';
18
18
  export { useToolbarFit } from './useToolbarFit.js';
@@ -1,6 +1,6 @@
1
1
  import { type RefObject } from 'react';
2
2
  import type { RowCursor } from '../listing/Listing.js';
3
- import { type PaneMove } from './PaneKeys.logic.js';
3
+ import { type PaneMove, type TabOrder } from './PaneKeys.logic.js';
4
4
  /** The two panes of a two-pane view: the sidebar and the page beside it. */
5
5
  export type Pane = 'sidebar' | 'main';
6
6
  /** What a view hands `usePaneKeys`. */
@@ -46,6 +46,13 @@ export interface PaneKeysOptions<Action extends {
46
46
  * runs. Without it, Tab from the sidebar goes to the page's home.
47
47
  */
48
48
  readonly sidebarStops?: boolean;
49
+ /**
50
+ * The order Tab walks the panes in (`TabOrder`): `document` (the
51
+ * default), every stop where the document puts it; `listing`, each
52
+ * pane's listing first, then its other controls, so Tab from the window
53
+ * lands in the page's listing however many controls stand above it.
54
+ */
55
+ readonly tabOrder?: TabOrder;
49
56
  /**
50
57
  * The view reads each pane's cursor row in render (`mainKey`,
51
58
  * `sidebarKey`), so a cursor move draws the view again: the default.
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, use
2
2
  import { isTextEditingTarget } from '../keyboard/Keyboard.logic.js';
3
3
  import { watchOverlays } from '../keyboard/OverlayWatch.js';
4
4
  import { createValueStore, unheard } from '../store/ValueStore.js';
5
- import { isTabStop, nextTabStop, pageRows, paneRow, paneRows, showRow, shownHome } from './PaneKeys.js';
5
+ import { isTabStop, nextTabStop, pageRows, paneRow, paneRows, showRow, shownHome, tabStops } from './PaneKeys.js';
6
6
  import { movedIndex, sameVerbs } from './PaneKeys.logic.js';
7
7
  /** The sidebar's cursor row: the one moved to while it is listed, else the open row, else the first. */
8
8
  const sidebarRow = (moved, keys, openKey) => (moved !== null && keys.includes(moved) ? moved : (openKey ?? keys[0] ?? null));
@@ -240,21 +240,41 @@ export function usePaneKeys(options) {
240
240
  // sidebar control (Refresh) switches panes as the listing does, and a
241
241
  // row's control out of the Tab order goes on from the page's home.
242
242
  const stop = node !== null && isTabStop(node) ? node : null;
243
- const from = pane === 'sidebar'
244
- ? walked !== null && stop !== null && !inRow
245
- ? stop
246
- : 'sidebar'
247
- : onHome || (inRow && stop === null)
248
- ? 'page'
249
- : node;
243
+ const listingFirst = current.tabOrder === 'listing';
244
+ // In a listing-first walk, a key aimed at neither pane (the view
245
+ // itself) goes on as from the page's listing, whichever pane was
246
+ // active (`listingFirstStop`).
247
+ const from = listingFirst && !inSidebar && !inMain
248
+ ? 'page'
249
+ : pane === 'sidebar'
250
+ ? walked !== null && stop !== null && !inRow
251
+ ? stop
252
+ : 'sidebar'
253
+ : onHome || (inRow && stop === null)
254
+ ? 'page'
255
+ : node;
250
256
  const back = 'back' in action && action.back === true;
251
- const to = nextTabStop(main, home, from, back, walked, sidebar === null);
257
+ const after = (stop) => nextTabStop(main, home, stop, back, walked, sidebar === null, listingFirst ? 'listing' : 'document');
252
258
  event.preventDefault();
253
259
  event.stopPropagation();
254
- if (to === 'sidebar' || to === 'page')
255
- focusPane(to === 'sidebar' ? 'sidebar' : 'main');
256
- else
260
+ // A stop the stylesheet hides (display: none) refuses the focus, so
261
+ // the walk goes on past it the same way, once round the stops at
262
+ // most, and ends on the pane's home when none takes it.
263
+ let to = after(from);
264
+ for (let left = tabStops(root).length;; left -= 1) {
265
+ if (to === 'sidebar' || to === 'page') {
266
+ focusPane(to === 'sidebar' ? 'sidebar' : 'main');
267
+ break;
268
+ }
257
269
  to.focus();
270
+ if (document.activeElement === to)
271
+ break;
272
+ if (left <= 0) {
273
+ focusPane(pane);
274
+ break;
275
+ }
276
+ to = after(to);
277
+ }
258
278
  return;
259
279
  }
260
280
  if (typing)
@@ -6,6 +6,20 @@ export interface SettingsSubsectionEntry {
6
6
  readonly id: string;
7
7
  readonly title: string;
8
8
  }
9
+ /**
10
+ * A sidebar row's chip with more than words: a glyph before them (an
11
+ * up arrow for an offered build, a restart for one ready) and a tooltip that
12
+ * says what they mean ("Update to 1.4.4"), which the row's accessible name
13
+ * reads in place of the bare words.
14
+ */
15
+ export interface SettingsChip {
16
+ /** The chip's words: "1.4.4". */
17
+ readonly text: string;
18
+ /** A glyph before the words, at the small icon size. */
19
+ readonly icon?: LucideIcon;
20
+ /** What the chip means, as its tooltip and in the row's accessible name. */
21
+ readonly tip?: string;
22
+ }
9
23
  /** One page of the Settings dialog, with its body ready to draw. */
10
24
  export interface SettingsPage {
11
25
  /** Unique across every page in the dialog. */
@@ -24,8 +38,12 @@ export interface SettingsPage {
24
38
  * its own box (an updates page's notes) while the rest stays put.
25
39
  */
26
40
  readonly fills?: boolean;
27
- /** A short label the page's sidebar row shows after its title as a warning chip (an offered build's version); none for none. */
28
- readonly chip?: string | null;
41
+ /**
42
+ * A short label the page's sidebar row shows after its title as a
43
+ * warning chip (an offered build's version), in words alone or with a
44
+ * glyph and a tooltip (`SettingsChip`); none for none.
45
+ */
46
+ readonly chip?: string | SettingsChip | null;
29
47
  readonly body: ReactNode;
30
48
  }
31
49
  /** A sidebar header and the pages under it, in the order they are listed. */
@@ -3,9 +3,9 @@ import { CircleAlert, Settings } from 'lucide-react';
3
3
  import { Fragment, useEffect, useLayoutEffect, useRef, useState } from 'react';
4
4
  import { Button } from '../button/Button.js';
5
5
  import { ModalDialog } from '../dialog/ModalDialog.js';
6
- import { ICON_MD } from '../icon/sizes.js';
6
+ import { ICON_MD, ICON_SM } from '../icon/sizes.js';
7
7
  import { useLabels } from '../labels/UiokProvider.js';
8
- import { cutTooltip } from '../tooltip/Tooltip.logic.js';
8
+ import { cutTooltip, tooltip } from '../tooltip/Tooltip.logic.js';
9
9
  import { spiedSubsection, subsectionScrollTop } from './SettingsDialog.logic.js';
10
10
  import { SettingsPageKeysContext, settingsLegend } from './SettingsPageKeys.js';
11
11
  import { SETTINGS_PAGE_HEAD_ATTRIBUTE, SETTINGS_REVEAL_ATTRIBUTE, SETTINGS_SUBSECTION_ATTRIBUTE } from './SettingsSubsection.js';
@@ -111,7 +111,17 @@ const keepFocus = (event) => event.preventDefault();
111
111
  */
112
112
  function SettingsSidebar({ groups, page, subsectionId, onPage, onSubsection }) {
113
113
  const labels = useLabels().settings;
114
- return (_jsx("nav", { "aria-label": labels.sidebar, className: "settings-sidebar scroll-fade", children: groups.map((group) => (_jsxs("div", { "aria-labelledby": `settings-group-${group.id}`, className: "settings-sidebar-group", role: "group", children: [_jsx("span", { className: "settings-sidebar-header overline", id: `settings-group-${group.id}`, children: group.title }), group.pages.map((item) => (_jsxs(Fragment, { children: [_jsxs("button", { "aria-current": item.id === page.id ? 'page' : undefined, className: "settings-sidebar-page", "data-settings-page": item.id, onClick: () => onPage(item.id), onMouseDown: keepFocus, type: "button", children: [_jsx(item.Icon, { "aria-hidden": true, size: ICON_MD }), _jsx("span", { ...cutTooltip(item.title), children: item.title }), item.chip ? _jsx("span", { className: "settings-sidebar-chip", children: item.chip }) : null] }), item.id === page.id && item.subsections.length > 0 ? (_jsx("div", { className: "settings-sidebar-subsections", children: item.subsections.map((subsection) => (_jsx("button", { "aria-current": subsection.id === subsectionId ? 'location' : undefined, className: "settings-sidebar-subsection", onClick: () => onSubsection(subsection.id), onMouseDown: keepFocus, type: "button", ...cutTooltip(subsection.title), children: subsection.title }, subsection.id))) })) : null] }, item.id)))] }, group.id))) }));
114
+ return (_jsx("nav", { "aria-label": labels.sidebar, className: "settings-sidebar scroll-fade", children: groups.map((group) => (_jsxs("div", { "aria-labelledby": `settings-group-${group.id}`, className: "settings-sidebar-group", role: "group", children: [_jsx("span", { className: "settings-sidebar-header overline", id: `settings-group-${group.id}`, children: group.title }), group.pages.map((item) => {
115
+ const chip = item.chip === undefined || item.chip === null || item.chip === ''
116
+ ? null
117
+ : typeof item.chip === 'string'
118
+ ? { text: item.chip }
119
+ : item.chip;
120
+ const ChipIcon = chip?.icon;
121
+ return (_jsxs(Fragment, { children: [_jsxs("button", { "aria-current": item.id === page.id ? 'page' : undefined, "aria-label": chip === null
122
+ ? undefined
123
+ : labels.pageWithChip(item.title, chip.tip ?? chip.text), className: "settings-sidebar-page", "data-settings-page": item.id, onClick: () => onPage(item.id), onMouseDown: keepFocus, type: "button", children: [_jsx(item.Icon, { "aria-hidden": true, size: ICON_MD }), _jsx("span", { ...cutTooltip(item.title), children: item.title }), chip === null ? null : (_jsxs("span", { className: "settings-sidebar-chip", ...(chip.tip === undefined ? {} : tooltip(chip.tip)), children: [ChipIcon === undefined ? null : _jsx(ChipIcon, { "aria-hidden": true, size: ICON_SM }), chip.text] }))] }), item.id === page.id && item.subsections.length > 0 ? (_jsx("div", { className: "settings-sidebar-subsections", children: item.subsections.map((subsection) => (_jsx("button", { "aria-current": subsection.id === subsectionId ? 'location' : undefined, className: "settings-sidebar-subsection", onClick: () => onSubsection(subsection.id), onMouseDown: keepFocus, type: "button", ...cutTooltip(subsection.title), children: subsection.title }, subsection.id))) })) : null] }, item.id));
124
+ })] }, group.id))) }));
115
125
  }
116
126
  /**
117
127
  * The Settings dialog: a fixed frame on the frosted wash, the sidebar of
@@ -14,7 +14,7 @@ export { AboutWindow, type AboutWindowProps } from './AboutWindow.js';
14
14
  export { LanguageChoice, type LanguageChoiceProps, type LanguageOption } from './LanguageChoice.js';
15
15
  export { LoadFailure, type LoadFailureProps } from './LoadFailure.js';
16
16
  export { BrandMark, Lockup, type BrandMarkLook, type BrandMarkProps, type BrandMarkShape, type LockupProps, type LockupSize } from './Lockup.js';
17
- export { SettingsDialog, SettingsSaveFailure, type SettingsDialogProps, type SettingsGroup, type SettingsPage, type SettingsPageRequest, type SettingsSaveFailureProps, type SettingsSubsectionEntry } from './SettingsDialog.js';
17
+ export { SettingsDialog, SettingsSaveFailure, type SettingsDialogProps, type SettingsGroup, type SettingsChip, type SettingsPage, type SettingsPageRequest, type SettingsSaveFailureProps, type SettingsSubsectionEntry } from './SettingsDialog.js';
18
18
  export { spiedSubsection, SUBSECTION_SCROLL_INSET_PX, SUBSECTION_SPY_SLACK_PX, subsectionScrollTop, type SettingsScrollView, type SubsectionAnchor } from './SettingsDialog.logic.js';
19
19
  export { SettingsFiles, type SettingsFileEntry, type SettingsFileProblem, type SettingsFileRequest, type SettingsFilesProps } from './SettingsFiles.js';
20
20
  export { SettingsPageKeysContext, settingsLegend, useSettingsPageKeys, type SettingsPageKeys } from './SettingsPageKeys.js';
package/dist/styles.css CHANGED
@@ -7,6 +7,7 @@
7
7
  @import './tokens.css';
8
8
 
9
9
  /* Component stylesheets, each beside its component. */
10
+ @import './icon/icon.css';
10
11
  @import './button/button.css';
11
12
  @import './tooltip/tooltip.css';
12
13
  @import './activity/activity.css';
@@ -283,11 +284,22 @@ meter::-webkit-meter-even-less-good-value {
283
284
  animation-timeline: scroll(self block);
284
285
  }
285
286
 
287
+ /* The inline fade runs from the inline start, where the scroll timeline
288
+ starts: the left edge, or the right in a right-to-left box, whose
289
+ scroll position counts down from its right edge. */
290
+ .scroll-fade-x {
291
+ --scroll-fade-inline-to: to right;
292
+ }
293
+
294
+ .scroll-fade-x:dir(rtl) {
295
+ --scroll-fade-inline-to: to left;
296
+ }
297
+
286
298
  .scroll-fade-x {
287
299
  mask-image:
288
300
  linear-gradient(var(--ground), var(--ground)), linear-gradient(var(--ground), var(--ground)),
289
301
  linear-gradient(
290
- to right,
302
+ var(--scroll-fade-inline-to),
291
303
  transparent,
292
304
  var(--ground) var(--scroll-fade-inline-start),
293
305
  var(--ground) calc(100% - var(--scroll-fade-inline-end)),
@@ -319,7 +331,7 @@ meter::-webkit-meter-even-less-good-value {
319
331
  transparent
320
332
  ),
321
333
  linear-gradient(
322
- to right,
334
+ var(--scroll-fade-inline-to),
323
335
  transparent,
324
336
  var(--ground) var(--scroll-fade-inline-start),
325
337
  var(--ground) calc(100% - var(--scroll-fade-inline-end)),
@@ -332,7 +344,7 @@ meter::-webkit-meter-even-less-good-value {
332
344
  linear-gradient(var(--ground), var(--ground)), linear-gradient(var(--ground), var(--ground)),
333
345
  linear-gradient(to bottom, var(--ground) calc(100% - var(--scroll-fade-end)), transparent),
334
346
  linear-gradient(
335
- to right,
347
+ var(--scroll-fade-inline-to),
336
348
  transparent,
337
349
  var(--ground) var(--scroll-fade-inline-start),
338
350
  var(--ground) calc(100% - var(--scroll-fade-inline-end)),
@@ -471,6 +483,7 @@ meter::-webkit-meter-even-less-good-value {
471
483
  .palette-level,
472
484
  .settings-sidebar-page,
473
485
  .settings-sidebar-subsection,
486
+ .sectioned-dialog-nav-row,
474
487
  .quiet-control,
475
488
  .quiet-track-item,
476
489
  .toggle-chip
@@ -489,6 +502,7 @@ meter::-webkit-meter-even-less-good-value {
489
502
  .pane-strip-link,
490
503
  .settings-sidebar-page,
491
504
  .settings-sidebar-subsection,
505
+ .sectioned-dialog-nav-row,
492
506
  .quiet-control,
493
507
  .toggle-chip
494
508
  ):where(button, a[href], [role='button'], [role='tab'], [role='radio']):where(
@@ -550,6 +564,7 @@ meter::-webkit-meter-even-less-good-value {
550
564
  .disclosure,
551
565
  .settings-sidebar-page,
552
566
  .settings-sidebar-subsection,
567
+ .sectioned-dialog-nav-row,
553
568
  .quiet-control,
554
569
  .quiet-track-item,
555
570
  .toggle-chip
@@ -0,0 +1,54 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ /** Props for {@link FactList}. */
3
+ export interface FactListProps {
4
+ /** Its heading, an overline over the facts ("Command"), which names the list too. */
5
+ readonly title?: string;
6
+ /** The list's accessible name, where it has no `title` or the title says less. */
7
+ readonly label?: string;
8
+ /** Its facts (`Fact`). */
9
+ readonly children: ReactNode;
10
+ }
11
+ /**
12
+ * A headed list of facts on a page (what a process runs, how it restarts),
13
+ * one name and value a line: the names in a column of their own in the
14
+ * dim interface face, each value beside its name in the code face. A long
15
+ * value wraps whole as a block beside its name, its next lines under its
16
+ * first, and never runs under the name or breaks the line's alignment. For
17
+ * facts read at a glance, set straight on the page (no card); a short table
18
+ * with a state each is a `FactTable`, and a list the keys move through is a
19
+ * `Listing`. Put several side by side in `FactColumns`. Draws
20
+ * `section.fact-list` with its `dl.fact-list-items`.
21
+ */
22
+ export declare function FactList({ title, label, children }: FactListProps): ReactElement;
23
+ /** A fact value's tone: `danger` a failure (an exit code, an error), `warning` a state that needs a look. */
24
+ export type FactValueTone = 'danger' | 'warning';
25
+ /** Props for {@link Fact}. */
26
+ export interface FactProps {
27
+ /** What the fact is ("Restarts"); an empty name lets the value run on under the line above. */
28
+ readonly name: string;
29
+ /** The value, in the code face ("2h 35m · since 11:48"). */
30
+ readonly children: ReactNode;
31
+ /** Its words in a tone; the text tone unless given. */
32
+ readonly tone?: FactValueTone;
33
+ /**
34
+ * The value is lines a program printed: its line breaks and runs of
35
+ * spaces kept as printed, each line wrapping whole.
36
+ */
37
+ readonly printed?: boolean;
38
+ }
39
+ /**
40
+ * One fact of a `FactList`: its name, then its value beside it, which wraps
41
+ * as a block however long it is. The words can be swept and copied.
42
+ */
43
+ export declare function Fact({ name, children, tone, printed }: FactProps): ReactElement;
44
+ /** Props for {@link FactColumns}. */
45
+ export interface FactColumnsProps {
46
+ /** The lists (`FactList`), in reading order. */
47
+ readonly children: ReactNode;
48
+ }
49
+ /**
50
+ * Fact lists side by side: as many columns of one width as the page has
51
+ * room for (three on a wide page), the lists flowing across and then down,
52
+ * so the lists of a row start on one line. Draws `.fact-columns`.
53
+ */
54
+ export declare function FactColumns({ children }: FactColumnsProps): ReactElement;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ /**
4
+ * A headed list of facts on a page (what a process runs, how it restarts),
5
+ * one name and value a line: the names in a column of their own in the
6
+ * dim interface face, each value beside its name in the code face. A long
7
+ * value wraps whole as a block beside its name, its next lines under its
8
+ * first, and never runs under the name or breaks the line's alignment. For
9
+ * facts read at a glance, set straight on the page (no card); a short table
10
+ * with a state each is a `FactTable`, and a list the keys move through is a
11
+ * `Listing`. Put several side by side in `FactColumns`. Draws
12
+ * `section.fact-list` with its `dl.fact-list-items`.
13
+ */
14
+ export function FactList({ title, label, children }) {
15
+ const headingId = useId();
16
+ const named = title === undefined ? {} : { 'aria-labelledby': headingId };
17
+ return (_jsxs("section", { "aria-label": label, className: "fact-list", ...(label === undefined ? named : {}), children: [title === undefined ? null : (_jsx("h3", { className: "fact-list-title overline", id: headingId, children: title })), _jsx("dl", { className: "fact-list-items", children: children })] }));
18
+ }
19
+ /**
20
+ * One fact of a `FactList`: its name, then its value beside it, which wraps
21
+ * as a block however long it is. The words can be swept and copied.
22
+ */
23
+ export function Fact({ name, children, tone, printed = false }) {
24
+ return (_jsxs("div", { className: "fact-list-item", "data-tone": tone, children: [_jsx("dt", { className: "fact-list-name", children: name }), _jsx("dd", { className: printed ? 'fact-list-value printed' : 'fact-list-value', children: children })] }));
25
+ }
26
+ /**
27
+ * Fact lists side by side: as many columns of one width as the page has
28
+ * room for (three on a wide page), the lists flowing across and then down,
29
+ * so the lists of a row start on one line. Draws `.fact-columns`.
30
+ */
31
+ export function FactColumns({ children }) {
32
+ return _jsx("div", { className: "fact-columns", children: children });
33
+ }
@@ -0,0 +1,44 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /**
3
+ * Where a fact stands: `ready` found and working, `warning` found but
4
+ * needing a look, `danger` missing or failing, `muted` not checked or not
5
+ * in use.
6
+ */
7
+ export type FactTone = 'ready' | 'warning' | 'danger' | 'muted';
8
+ /** Props for {@link FactTable}. */
9
+ export interface FactTableProps {
10
+ /** The table's accessible name: "Tools". */
11
+ readonly label: string;
12
+ /** Its rows (`FactRow`). */
13
+ readonly children: ReactNode;
14
+ }
15
+ /**
16
+ * A short table of facts on a settings page or a detail page, one thing a
17
+ * row: the state glyph of each, its name, a detail (where it is, in the
18
+ * code face), and a value at the row's end (a version, "found"), the
19
+ * columns aligned across the rows and ruled by hairlines above, between,
20
+ * and under them. For what a page checks and reports, not for what the user
21
+ * edits (a `FieldRow`'s) or a list the keys move through (a `Listing`).
22
+ * Draws `.fact-table` with `role="table"`.
23
+ */
24
+ export declare function FactTable({ label, children }: FactTableProps): ReactElement;
25
+ /** Props for {@link FactRow}. */
26
+ export interface FactRowProps {
27
+ /** Where the fact stands, which picks its glyph and the glyph's tone. */
28
+ readonly tone: FactTone;
29
+ /** The state in words, the glyph's accessible name and tooltip: "Found", "Missing". */
30
+ readonly toneLabel: string;
31
+ /** What the fact is about: "Homebrew". */
32
+ readonly name: string;
33
+ /** Where it is, or how it is found, in the code face: a path, a command. A string cut short shows whole in its tooltip. */
34
+ readonly detail?: ReactNode;
35
+ /** The value at the row's end, in the code face: a version, "found". */
36
+ readonly value?: ReactNode;
37
+ }
38
+ /**
39
+ * One row of a `FactTable`: its state glyph in the state's text tone (a
40
+ * check, a warning triangle, a cross, or a dashed ring, each a shape of its
41
+ * own), the name in the interface face, the detail and the value in the
42
+ * code face, the value right-aligned. The words can be swept and copied.
43
+ */
44
+ export declare function FactRow({ tone, toneLabel, name, detail, value }: FactRowProps): ReactElement;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CircleCheck, CircleDashed, CircleX, TriangleAlert } from 'lucide-react';
3
+ import { ICON_MD } from '../icon/sizes.js';
4
+ import { cutTooltip, tooltip } from '../tooltip/Tooltip.logic.js';
5
+ /** Each tone's glyph: a shape of its own, so a fact's state reads without its hue. */
6
+ const GLYPHS = {
7
+ ready: CircleCheck,
8
+ warning: TriangleAlert,
9
+ danger: CircleX,
10
+ muted: CircleDashed
11
+ };
12
+ /**
13
+ * A short table of facts on a settings page or a detail page, one thing a
14
+ * row: the state glyph of each, its name, a detail (where it is, in the
15
+ * code face), and a value at the row's end (a version, "found"), the
16
+ * columns aligned across the rows and ruled by hairlines above, between,
17
+ * and under them. For what a page checks and reports, not for what the user
18
+ * edits (a `FieldRow`'s) or a list the keys move through (a `Listing`).
19
+ * Draws `.fact-table` with `role="table"`.
20
+ */
21
+ export function FactTable({ label, children }) {
22
+ return (_jsx("div", { "aria-label": label, className: "fact-table", role: "table", children: children }));
23
+ }
24
+ /**
25
+ * One row of a `FactTable`: its state glyph in the state's text tone (a
26
+ * check, a warning triangle, a cross, or a dashed ring, each a shape of its
27
+ * own), the name in the interface face, the detail and the value in the
28
+ * code face, the value right-aligned. The words can be swept and copied.
29
+ */
30
+ export function FactRow({ tone, toneLabel, name, detail, value }) {
31
+ const Glyph = GLYPHS[tone];
32
+ return (_jsxs("div", { className: "fact-row", "data-tone": tone, role: "row", children: [_jsx("span", { className: "fact-state", role: "cell", children: _jsx(Glyph, { "aria-label": toneLabel, role: "img", size: ICON_MD, ...tooltip(toneLabel) }) }), _jsx("span", { className: "fact-name", role: "cell", ...cutTooltip(name), children: name }), _jsx("span", { className: "fact-detail", role: "cell", ...(typeof detail === 'string' ? cutTooltip(detail) : {}), children: detail }), _jsx("span", { className: "fact-value", role: "cell", children: value })] }));
33
+ }
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
- * lifted panel for one subject's lines; `GroupSwatch`, a group's colour
4
- * beside its name; and `Tag`, a small worded tag in a tone.
3
+ * lifted panel for one subject's lines; `FactTable` of `FactRow`s, a page's
4
+ * short table of facts with a state glyph each; `FactList` of `Fact`s, a
5
+ * headed list of facts whose long values wrap whole, set side by side in
6
+ * `FactColumns`; `GroupSwatch`, a group's
7
+ * colour beside its name; and `Tag`, a small worded tag in a tone.
5
8
  */
6
9
  export { Card, type CardProps } from './Card.js';
10
+ export { Fact, FactColumns, FactList, type FactColumnsProps, type FactListProps, type FactProps, type FactValueTone } from './FactList.js';
11
+ export { FactRow, FactTable, type FactRowProps, type FactTableProps, type FactTone } from './FactTable.js';
7
12
  export { Notice, type NoticeProps, type NoticeTone } from './Notice.js';
8
13
  export { GroupSwatch, type GroupSwatchProps } from './GroupSwatch.js';
9
14
  export { Tag, type TagProps, type TagTone } from './Tag.js';
@@ -1,9 +1,14 @@
1
1
  /**
2
2
  * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
- * lifted panel for one subject's lines; `GroupSwatch`, a group's colour
4
- * beside its name; and `Tag`, a small worded tag in a tone.
3
+ * lifted panel for one subject's lines; `FactTable` of `FactRow`s, a page's
4
+ * short table of facts with a state glyph each; `FactList` of `Fact`s, a
5
+ * headed list of facts whose long values wrap whole, set side by side in
6
+ * `FactColumns`; `GroupSwatch`, a group's
7
+ * colour beside its name; and `Tag`, a small worded tag in a tone.
5
8
  */
6
9
  export { Card } from './Card.js';
10
+ export { Fact, FactColumns, FactList } from './FactList.js';
11
+ export { FactRow, FactTable } from './FactTable.js';
7
12
  export { Notice } from './Notice.js';
8
13
  export { GroupSwatch } from './GroupSwatch.js';
9
14
  export { Tag } from './Tag.js';