@bigpixelrocket/uiok 0.5.0 → 0.7.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 (107) hide show
  1. package/CHANGELOG.md +72 -1
  2. package/dist/button/TextLink.d.ts +21 -2
  3. package/dist/button/TextLink.js +14 -3
  4. package/dist/button/button.css +7 -0
  5. package/dist/dialog/SectionedDialog.d.ts +37 -0
  6. package/dist/dialog/SectionedDialog.js +158 -0
  7. package/dist/dialog/dialog.css +102 -0
  8. package/dist/dialog/index.d.ts +4 -2
  9. package/dist/dialog/index.js +4 -2
  10. package/dist/field/FieldLayout.d.ts +3 -2
  11. package/dist/field/FieldLayout.js +8 -3
  12. package/dist/frame/AppRoot.d.ts +1 -1
  13. package/dist/frame/AppRoot.js +2 -1
  14. package/dist/frame/Dock.d.ts +1 -1
  15. package/dist/frame/Dock.js +2 -1
  16. package/dist/frame/FilterChips.d.ts +5 -2
  17. package/dist/frame/FilterChips.js +35 -2
  18. package/dist/frame/FilterChips.logic.d.ts +24 -0
  19. package/dist/frame/FilterChips.logic.js +34 -0
  20. package/dist/frame/PageParts.d.ts +4 -3
  21. package/dist/frame/PageParts.js +10 -3
  22. package/dist/frame/SideBySide.d.ts +33 -0
  23. package/dist/frame/SideBySide.js +62 -0
  24. package/dist/frame/Tree.d.ts +20 -7
  25. package/dist/frame/Tree.js +21 -8
  26. package/dist/frame/WindowFrame.d.ts +1 -1
  27. package/dist/frame/WindowFrame.js +2 -1
  28. package/dist/frame/frame.css +56 -1
  29. package/dist/frame/index.d.ts +4 -2
  30. package/dist/frame/index.js +4 -2
  31. package/dist/grid/grid.css +1 -0
  32. package/dist/keyboard/Keyboard.logic.js +20 -3
  33. package/dist/keychord/KeyChord.d.ts +21 -4
  34. package/dist/keychord/KeyChord.js +24 -5
  35. package/dist/keychord/ShortcutIndex.d.ts +49 -0
  36. package/dist/keychord/ShortcutIndex.js +28 -0
  37. package/dist/keychord/index.d.ts +8 -2
  38. package/dist/keychord/index.js +8 -2
  39. package/dist/keychord/keychord.css +101 -0
  40. package/dist/labels/dialog.d.ts +2 -0
  41. package/dist/labels/dialog.js +2 -1
  42. package/dist/labels/keys.d.ts +5 -0
  43. package/dist/labels/keys.js +2 -1
  44. package/dist/legend/legend.css +6 -10
  45. package/dist/listing/Listing.d.ts +54 -4
  46. package/dist/listing/Listing.js +61 -7
  47. package/dist/listing/PaneMessage.d.ts +7 -4
  48. package/dist/listing/PaneMessage.js +11 -4
  49. package/dist/listing/index.d.ts +1 -1
  50. package/dist/listing/listing.css +124 -5
  51. package/dist/menu/Menu.d.ts +52 -8
  52. package/dist/menu/Menu.js +288 -80
  53. package/dist/menu/Menu.logic.d.ts +39 -12
  54. package/dist/menu/Menu.logic.js +36 -8
  55. package/dist/menu/index.d.ts +4 -3
  56. package/dist/menu/index.js +2 -1
  57. package/dist/menu/menu.css +4 -0
  58. package/dist/palette/Palette.d.ts +3 -1
  59. package/dist/palette/Palette.js +14 -2
  60. package/dist/palette/PaletteRows.d.ts +28 -14
  61. package/dist/palette/PaletteRows.js +21 -17
  62. package/dist/pane/Pane.d.ts +50 -6
  63. package/dist/pane/Pane.js +112 -5
  64. package/dist/pane/PaneKeys.d.ts +5 -1
  65. package/dist/pane/PaneKeys.js +28 -3
  66. package/dist/pane/PaneKeys.logic.d.ts +25 -0
  67. package/dist/pane/PaneKeys.logic.js +30 -0
  68. package/dist/pane/PaneTabs.js +7 -3
  69. package/dist/pane/index.d.ts +1 -1
  70. package/dist/pane/index.js +1 -1
  71. package/dist/pane/panetabs.css +14 -2
  72. package/dist/pane/usePaneKeys.d.ts +8 -1
  73. package/dist/pane/usePaneKeys.js +32 -12
  74. package/dist/styles.css +40 -3
  75. package/dist/surface/FactList.d.ts +54 -0
  76. package/dist/surface/FactList.js +33 -0
  77. package/dist/surface/index.d.ts +4 -1
  78. package/dist/surface/index.js +4 -1
  79. package/dist/surface/surface.css +85 -2
  80. package/dist/terminal/TerminalMenu.js +1 -1
  81. package/dist/terminal/ghostty/core.d.ts +12 -4
  82. package/dist/terminal/ghostty/core.js +12 -4
  83. package/dist/terminal/index.d.ts +4 -2
  84. package/dist/terminal/index.js +4 -2
  85. package/dist/terminal/terminal.css +3 -2
  86. package/dist/text/Code.d.ts +15 -0
  87. package/dist/text/Code.js +12 -0
  88. package/dist/text/index.d.ts +6 -1
  89. package/dist/text/index.js +6 -1
  90. package/dist/text/text.css +21 -0
  91. package/dist/themes/tokens.js +8 -3
  92. package/dist/tokens.css +4 -0
  93. package/dist/viewer/HexView.js +17 -8
  94. package/dist/viewer/ImageView.js +5 -3
  95. package/dist/viewer/PdfView.d.ts +8 -1
  96. package/dist/viewer/PdfView.js +27 -2
  97. package/dist/viewer/SyntaxHighlighter.d.ts +3 -2
  98. package/dist/viewer/SyntaxHighlighter.js +7 -2
  99. package/dist/viewer/SyntaxLanguage.logic.d.ts +5 -0
  100. package/dist/viewer/SyntaxLanguage.logic.js +17 -3
  101. package/dist/viewer/SyntaxService.d.ts +3 -1
  102. package/dist/viewer/SyntaxService.js +8 -1
  103. package/dist/viewer/TextView.js +14 -7
  104. package/dist/viewer/ViewerClipboard.js +17 -6
  105. package/dist/viewer/ViewerFrame.logic.js +4 -1
  106. package/dist/viewer/types.d.ts +3 -2
  107. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,75 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.7.0] - 2026-11-23
10
+
11
+ ### Added
12
+
13
+ - `TreeRow`'s `onContextMenu(event, rowKey)`: a secondary click for a tree row's menu, as a listing `Row`'s. The row moves the pane's cursor to itself before calling it and cancels the browser's own menu, so its handler wins over its `TreeList`'s and `TreePane`'s. With the focus on the tree's `TreeList`, the Menu key or Shift-F10 runs the cursor row's, its event placed under the row.
14
+ - `TextLink`'s `verb` (`ControlVerb`, `data-verb`): a link in a listing row, such as a service's port, becomes one of the row's controls, out of the Tab order unless the row is `tabbable`, reached by the cursor row's keys through `verbControl`, and run without opening the row. Without a `verb`, or outside a row, a link keeps its Tab stop.
15
+ - A `FactList` or `FactColumns` set straight in a pane's body (a `PaneList`, `PanePage`, `PageSlot`, or `SideBySide` part) keeps the rows' inset from the pane's edge (`--pane-row-inset`) and `--space-4` above and below, instead of sitting flush with it.
16
+ - `Row`'s `nameTip` and `nameDescription`: the host's words about a row's name. `nameTip` (a narrow pane's dropped columns, say) is the name's tooltip at every width, under the whole name (a name in markup by its drawn words), in place of the tooltip a cut name shows alone. `nameDescription` (the row's kind) and the tip's words, in that order, describe the name's cell, the row when it takes the focus (`focusable`, `tabbable`), and a radio row's radio. Neither repeats the name.
17
+ - The pane docs demo walks Tab listing first (`usePaneKeys`' `tabOrder: 'listing'`) beside the browser's own order, Escape giving the focus back to that choice, and the frame demo opens a tree row's menu, from a secondary click or, through its Focus the tree button, the keys.
18
+
19
+ ### Changed
20
+
21
+ - Breaking: a `PaletteOption`'s accessible name is now every word it draws, in the order drawn (its name, its `context`, then its trail, a `KeyChord` by its words, and `current`'s value), read from its content, so it holds the text on screen (WCAG 2.5.3, axe `label-content-name-mismatch`). Its `aria-description` is now only the caller's `description`, for what the row does not draw (why it is disabled). 0.6.0 advised voicing a chord or the context through `description`: a caller that did so drops that text from `description`, or the row reads it twice. `label` now stands in for the drawn name's words alone (pass it for a `MarkedText` name), the context and trail still read after it; an empty `label` is none.
22
+
23
+ ### Fixed
24
+
25
+ - A right-to-left box keeps its inline edge fade (`.scroll-fade-x`) on the right side and a submenu's chevron pointing left after an app's bundler processes the stylesheet, and the key legend's overflow list ends at the chip's left edge. Lightning CSS (Vite) rewrote `:dir(rtl)` into `:lang()` selectors, which a `dir="rtl"` box in an English page does not match; the fade and the chevron now follow the nearest `dir` attribute (`--scroll-fade-inline-to`, `--inline-flip`), reading `:dir()` only under `dir="auto"`, whose direction comes from its text, and the list sits by a logical inset.
26
+ - Return on a command in a `Palette` no longer closes it and opens it again: the query field (`PaletteQuery`) cancels Return's default before the host's `onKeyDown` runs, so a host that hands the focus back to the button that opened the palette on close, even one that stops the key, does not see the browser click that button with the same key. Return on a button inside the palette still presses it.
27
+ - A `TextLink` in a selected listing row takes the selection's words (`--on-selected`, a disabled one `--on-selected-dim`) while the selection is active, instead of its accent or danger tone on the accent fill, which could vanish (1:1 in Catppuccin Mocha). An inactive selection keeps the link's own tone.
28
+ - `PaneTabs` no longer nests each tab's close control inside its `role="tab"` element (axe `nested-interactive`): the `.pane-tab` box is presentational and holds the tab, `.pane-tab-face`, with the close control beside it, out of the Tab order and the pointer's alone (`aria-hidden`, since a tab list owns tabs alone; the host's close chord closes a tab from the keyboard and assistive technology). The look, presses, drag, and folding are unchanged; a stylesheet that reached a tab's mark, name, dirty mark, or pin as the box's direct children reaches them under `.pane-tab-face`.
29
+ - `KeyChord` draws its chord as a `<kbd role="img">`, so its name in words ("Shift Command N") is allowed and read, in a control round it too, where an `aria-label` on a bare `<kbd>` was not (axe `aria-prohibited-attr`). `KeyChords` keeps its "or" apart from the chords in a name read from the content, and `Menu` and the terminal's menu keep an item's label, its current mark's words, and its chord's apart in its name ("Copy Path Option Command C").
30
+ - A `TreeTool`'s words (a note, a heading, a failed read) that a narrow sidebar cuts with an ellipsis show whole in a tooltip while cut, as a cut tree row's name does.
31
+ - A `PageNote` or `PaneMessage` too long for one line wraps its words in their own column beside the glyph (a hanging indent), not under the glyph; `PageNote` draws its words in the same `.pane-message-text` box. A glyph of the host's own leading a `PaneMessage`'s words is drawn at `--icon-md`, and the words after it hang in their own column too.
32
+ - A `Toolbar` set straight in a pane's body (a `PaneList`, `PanePage`, `PageSlot`, or `SideBySide` part) keeps the rows' inset (`--pane-row-inset`) from the pane's edges instead of touching them.
33
+ - A `.terminal-box` that nothing gives a height falls back to the new fixed token `--terminal-box-default-height` (200px, `TERMINAL_BOX_HEIGHT`) instead of collapsing.
34
+ - A mouse's second button pressed while another is held, after a Shift-F10 the browser left alone, opens the pane's menu again, not the cursor row's: `PaneList` forgets the menu key on a `mousedown` as well as a `pointerdown`.
35
+ - `SectionedDialog` focuses a section's first control past the column's end without throwing where the engine has no `scrollIntoView` (jsdom).
36
+ - `SideBySide` applies a changed `from` without the scrollbar hold on the first width measured against it, so a pair hidden while `from` rose comes back stacked if it is now too narrow; one hidden and shown again with the same `from` keeps its hold.
37
+ - `ViewerWindow` no longer takes a file named `constructor`, an extension or interpreter such as `valueOf`, or a media type such as `toString` for an `Object.prototype` member, which posted a function to the highlighting worker and took the viewer down; the worker answers failed for a language it does not ship.
38
+ - A PDF named `.`, `..`, or nothing, or whose name cannot be encoded (a lone surrogate), opens as `document.pdf` below its media URL instead of resolving to the URL's parent or failing. A PDF's `mediaUrl` carries no query or fragment.
39
+ - A text or hex view's drag ends with the view and before the next drag starts, so a lost mouseup or an unmount leaves no window listeners or scroll timer behind.
40
+ - The viewer says the copy failed on a page with no clipboard API (an insecure origin) instead of showing the raw error, and checks that a copy is still the latest in the same step that starts its write, so an overtaken copy never overwrites a newer one.
41
+ - The image view leaves an arrow a control already handled alone, and its arrow keys and the hex view's selection steps are looked up by own keys only. The keyboard table no longer says Shift with an arrow extends a text view's selection; only the hex view's does.
42
+ - `FieldGroup` names its note in the fieldset's `aria-describedby`, after the problem, and draws no note for `note={false}`, as `FieldRow` does.
43
+
44
+ ## [0.6.0] - 2026-11-23
45
+
46
+ ### Added
47
+
48
+ - `SectionedDialog`, `SectionedDialogProps`, and `DialogSection` (`@bigpixelrocket/uiok/dialog`): a form too long for one view, in a fixed frame with a sidebar of its sections beside a column that scrolls, each section headed by its name; the sidebar marks the section in view as the column scrolls, a row scrolls the column to its section, and a row run from the keyboard moves the focus to the section's first control. The `dialog` label `sections` names the sidebar.
49
+ - `FactList`, `Fact`, `FactColumns`, and `FactValueTone` (`@bigpixelrocket/uiok/surface`): a headed list of facts set straight on a page, the names in a column of their own and each value beside its name, a long value wrapping whole as a block, a printed one keeping its lines; lists side by side in as many columns as fit.
50
+ - `Code` (`@bigpixelrocket/uiok/text`): a command, a path, or a name inside a sentence, in the code face on a faint track, wrapping anywhere.
51
+ - `ShortcutIndex`, `ShortcutGroup`, and `ShortcutRow` (`@bigpixelrocket/uiok/keychord`): every key a window answers, in groups of verbs whose chords stand in one column across the groups, with a changed chord's accent caps, a verb with no chord, and a dimmed verb.
52
+ - `Row`'s `radio` (`RowRadio`): a row that is one choice of several, led by a radio named by the row's name, its cursor key reached through a `verb`.
53
+ - `PaneBox`'s `bell`: the visual bell, which shoves the cursor row sideways for one beat each time its count rises, or flashes the selection fill under reduced motion.
54
+ - `TextLink`'s `tone` (`danger`): a link to something failing (a log file whose writes fail) in the danger tone, its `tip` (the reason) its accessible description too.
55
+ - `KeyChords` (`@bigpixelrocket/uiok/keychord`): several chords for one verb, parted by the new `keys` label `or`, drawn and read between them, so two chords never run together; `ShortcutRow` draws its chords with it.
56
+ - `usePaneKeys`'s `tabOrder` and `nextTabStop`'s `order` (`TabOrder`): `listing` walks each pane's listing first, then its other controls, then the other pane's listing, over the pure rule `listingFirstStop` (`WalkPane`).
57
+ - `Row`'s `onContextMenu(event, rowKey)`: a secondary click for the row's menu. The row moves the pane's cursor to itself before calling it, and cancels the browser's own menu. From the keyboard, the Menu key or Shift-F10 on a pane's home (`PaneList` with `home`) runs the cursor row's, its event placed under the row.
58
+ - `RegionHandlers`' `onContextMenu`, so every part that takes the region handlers (`PaneBox`, `PaneList`, `SpacePanel`, `WindowFrame`'s `group`, `Dock`, `TreePane`, `TreeList`) takes a secondary click for its own menu. The innermost menu wins: a row's, then its pane's, then the region's around it, each running only for a click nothing inside cancelled, so one click never opens two menus. A secondary click in a text field is never claimed, so the field keeps the browser's own Cut, Copy, and Paste menu.
59
+ - `Menu`'s submenus (`MenuSubmenuEntry`, `{ kind: 'submenu', id, label, entries }`), one level deep (`MenuLeafEntry`): an item that opens a second menu beside it, on its inline-end side or the other with no room there (`placeMenu`'s `{ beside, rtl }`, `MenuFrom`). → (← right to left), Return, or Space opens it with the keys on its first item, ← goes back to its item, Escape closes it alone and Tab the whole menu; resting on or pressing its item opens it for the pointer, which may cross other items on its way in. Both menus read in the direction of what opened them (`Menu`'s new `dir`, else its anchor's or its place's). The item is a `menuitem` with `aria-haspopup="menu"` and `aria-expanded`, the submenu a `menu` labelled by it.
60
+ - `PaletteOption`'s `checked`: a row picked with others (the scripts a project includes), an `option` with `aria-checked` and the menu's check mark in its icon column while ticked. A press, or Return on the cursor row, toggles it through `onPick`; Space stays in the query.
61
+ - `SideBySide` (`@bigpixelrocket/uiok/frame`): two of a page's listings or sections side by side while the room the pair itself is given is `from` pixels wide or more, stacked in less, each a group named by its label. It measures its own width (`data-layout`), so a narrowed pane stacks them in a wide window, and holds no cursor: the page's one cursor walks the first part's rows, then the second's.
62
+ - `FilterChips` keeps to one line: chips that do not fit scroll sideways under the inline edge fade (`.scroll-fade-x`) with no scrollbar drawn, a mouse's vertical wheel scrolls the row sideways while it can move that way (left to the page otherwise; a trackpad's sideways swipe stays the browser's), and a chip the keys reach scrolls into view. Nothing scrolls smoothly.
63
+ - `BUDGETED_TERMINALS_PER_PAGE` (`@bigpixelrocket/uiok/terminal`): how many terminals one page's shared engine memory is budgeted for (17), so an app can test how many it opens against it; past it, terminals that fill their histories to the ceiling can exhaust the shared memory.
64
+
65
+ ### Changed
66
+
67
+ - `menuKeyAction(event, rtl)` maps → and ← (`open`, `back`), and its `close` says whether it closes one level (Escape, `all: false`) or the whole menu (Tab, `all: true`). A `Menu` now holds → and ← too, which no longer reach its owner while it is open.
68
+ - `KeyLabels` takes `or` ("or" in English). An app that builds a whole `keys` group of its own, not an override through `UiokProvider`, adds it.
69
+ - `DialogLabels` takes `sections` ("Sections" in English), the name of a `SectionedDialog`'s sidebar. An app that builds a whole `dialog` group of its own adds it.
70
+ - `PaneMessage` draws its words in one `.pane-message-text`, so inline code flows with them.
71
+ - `PaneMessage` and `PageNote` drawn outside every listing scope carry the scope themselves (a `.listing-root` around them), as `Listing` does, so a note after a listing keeps its look anywhere.
72
+
73
+ ### Fixed
74
+
75
+ - Tab from a pane's listing (`usePaneKeys`) no longer stops on a control the stylesheet hides, which refused the focus and held Tab in place, nor on a hidden input: the walk goes on past such a stop in the same direction, and ends on the pane's home if none takes the focus.
76
+ - `isTextEditingTarget` resolves inherited editability as the browser does (`isContentEditable`, else the nearest `contenteditable` that is not `inherit`), so editable content inside an editable parent counts as a text field and keeps its native menu and keys.
77
+
9
78
  ## [0.5.0] - 2026-11-23
10
79
 
11
80
  ### Added
@@ -271,7 +340,9 @@ The first published version. The package is published to npm as `@bigpixelrocket
271
340
  - `lucide-react` 1.31 or later within 1.x is a peer dependency.
272
341
  - Terminal (`@bigpixelrocket/uiok/terminal`, `docs/components/terminal.md`): `Terminal`, Ghostty's VT engine as WebAssembly drawn on a canvas, read-only without `onInput`, with a Copy and Paste menu whose chords come from `menuChords`, a visual bell, line-editing actions bound by `actionForKey`, and `TerminalScrollbackContext`. The package root does not export it, so an app without a terminal never loads its assets. Its words are the new `terminal` label group; the package now ships a `NOTICE` with the engine's, adapter's, and font's licences.
273
342
 
274
- [Unreleased]: https://github.com/Bigpixelrocket/uiok/compare/v0.5.0...HEAD
343
+ [Unreleased]: https://github.com/Bigpixelrocket/uiok/compare/v0.7.0...HEAD
344
+ [0.7.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.6.0...v0.7.0
345
+ [0.6.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.5.0...v0.6.0
275
346
  [0.5.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.4.0...v0.5.0
276
347
  [0.4.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.3.0...v0.4.0
277
348
  [0.3.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.3...v0.3.0
@@ -1,5 +1,6 @@
1
1
  import type { LucideIcon } from 'lucide-react';
2
2
  import type { ReactElement } from 'react';
3
+ import { type ControlVerb } from '../pane/PaneActions.js';
3
4
  /** Props for {@link TextLink}. */
4
5
  export interface TextLinkProps {
5
6
  /**
@@ -29,6 +30,21 @@ export interface TextLinkProps {
29
30
  readonly tip?: string;
30
31
  /** The chord that opens it, as text, written after the tooltip's words. */
31
32
  readonly shortcut?: string;
33
+ /**
34
+ * `danger`: what it opens is failing (a log file whose writes fail), so
35
+ * its words and glyph take the danger tone, and its `tip` (the reason)
36
+ * is its accessible description too, so a screen reader says why.
37
+ */
38
+ readonly tone?: 'danger';
39
+ /**
40
+ * What the keys run it for (`data-verb`, read by `verbControl`), for a link
41
+ * in a listing row such as a service's port: there it leaves the Tab
42
+ * order, as a row's `QuietAction` and `RowIconAction` do, so the cursor
43
+ * row's keys reach it instead of Tab, and a press runs it without opening
44
+ * the row. A `tabbable` row keeps it in the Tab order; outside a row it
45
+ * changes nothing but the attribute.
46
+ */
47
+ readonly verb?: ControlVerb;
32
48
  }
33
49
  /**
34
50
  * A link in words: a button that reads as a link inside a sentence, a
@@ -37,7 +53,10 @@ export interface TextLinkProps {
37
53
  * takes the keyboard's focus with the shared ring. It is a button because
38
54
  * the host decides how to open what it names (an external browser, a tab),
39
55
  * so it never navigates the page itself. A `disabled` link dims and
40
- * refuses the press; `label` names it when its words are short. Styled by `.text-link` in
56
+ * refuses the press; `label` names it when its words are short; `tone`
57
+ * `danger` sets it in the danger tone with its reason described. With a
58
+ * `verb`, a link in a listing row is one of the row's controls: out of the
59
+ * Tab order, reached by the cursor row's keys. Styled by `.text-link` in
41
60
  * `@bigpixelrocket/uiok/styles.css`.
42
61
  */
43
- export declare function TextLink({ children, onClick, icon: Icon, code, tip, shortcut, label, disabled }: TextLinkProps): ReactElement;
62
+ export declare function TextLink({ children, onClick, icon: Icon, code, tip, shortcut, label, disabled, tone, verb }: TextLinkProps): ReactElement;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ICON_SM } from '../icon/sizes.js';
3
+ import { useInRow } from '../pane/PaneActions.js';
3
4
  import { tooltip } from '../tooltip/Tooltip.logic.js';
4
5
  /**
5
6
  * A link in words: a button that reads as a link inside a sentence, a
@@ -8,9 +9,19 @@ import { tooltip } from '../tooltip/Tooltip.logic.js';
8
9
  * takes the keyboard's focus with the shared ring. It is a button because
9
10
  * the host decides how to open what it names (an external browser, a tab),
10
11
  * so it never navigates the page itself. A `disabled` link dims and
11
- * refuses the press; `label` names it when its words are short. Styled by `.text-link` in
12
+ * refuses the press; `label` names it when its words are short; `tone`
13
+ * `danger` sets it in the danger tone with its reason described. With a
14
+ * `verb`, a link in a listing row is one of the row's controls: out of the
15
+ * Tab order, reached by the cursor row's keys. Styled by `.text-link` in
12
16
  * `@bigpixelrocket/uiok/styles.css`.
13
17
  */
14
- export function TextLink({ children, onClick, icon: Icon, code = false, tip, shortcut, label, disabled = false }) {
15
- return (_jsxs("button", { "aria-label": label, className: code ? 'text-link code' : 'text-link', disabled: disabled, onClick: onClick, type: "button", ...(tip === undefined && shortcut === undefined ? {} : tooltip(tip ?? children, shortcut)), children: [Icon === undefined ? null : _jsx(Icon, { "aria-hidden": true, size: ICON_SM }), _jsx("span", { className: "text-link-words", children: children })] }));
18
+ export function TextLink({ children, onClick, icon: Icon, code = false, tip, shortcut, label, disabled = false, tone, verb }) {
19
+ // A link the row's keys run is one of the row's controls.
20
+ const rowControl = useInRow() && verb !== undefined;
21
+ return (_jsxs("button", { "aria-description": tone === 'danger' ? tip : undefined, "aria-label": label, className: ['text-link', code ? 'code' : '', tone ?? ''].filter(Boolean).join(' '), "data-verb": verb, disabled: disabled, onClick: (event) => {
22
+ // A row's control runs alone, never opening the row around it too.
23
+ if (verb !== undefined)
24
+ event.stopPropagation();
25
+ onClick();
26
+ }, tabIndex: rowControl ? -1 : undefined, type: "button", ...(tip === undefined && shortcut === undefined ? {} : tooltip(tip ?? children, shortcut)), children: [Icon === undefined ? null : _jsx(Icon, { "aria-hidden": true, size: ICON_SM }), _jsx("span", { className: "text-link-words", children: children })] }));
16
27
  }
@@ -309,3 +309,10 @@
309
309
  .text-link:disabled {
310
310
  color: var(--text-dim);
311
311
  }
312
+
313
+ /* What it opens is failing (`tone="danger"`): the words and glyph in the
314
+ danger text tone, which keeps 4.5:1 as the accent's does; the reason is
315
+ its tooltip and description. A disabled one still dims. */
316
+ .text-link.danger:not(:disabled) {
317
+ color: var(--danger-text);
318
+ }
@@ -0,0 +1,37 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import { type ModalDialogProps } from './ModalDialog.js';
3
+ /** One headed group of a `SectionedDialog`. */
4
+ export interface DialogSection {
5
+ /** Names the section to the sidebar; unique in the dialog, the same in every language. */
6
+ readonly id: string;
7
+ /** Its name, in the sidebar and as the overline over its rows: "Depends on". */
8
+ readonly title: string;
9
+ /** Its rows: a `FieldGrid` of `FieldRow`s, notes, a listing. */
10
+ readonly children: ReactNode;
11
+ }
12
+ /** Props for {@link SectionedDialog}. */
13
+ export interface SectionedDialogProps extends Omit<ModalDialogProps, 'children' | 'size'> {
14
+ /** The body's groups, in order; the sidebar lists them in the same order. */
15
+ readonly sections: readonly DialogSection[];
16
+ /** The section brought to the top as the dialog opens; the first unless given. */
17
+ readonly openAt?: string;
18
+ /**
19
+ * A line over the scrolling column that stays in view however far it is
20
+ * scrolled: a save that failed (a danger `Notice`).
21
+ */
22
+ readonly notice?: ReactNode;
23
+ }
24
+ /**
25
+ * A form too long for one view (a command's settings, a connection's
26
+ * options), in a dialog with a sidebar of its sections beside a column that
27
+ * scrolls: each section's name heads its group as an overline, a hairline
28
+ * between groups. The sidebar marks the section in view and follows the
29
+ * column as it scrolls, the way the Settings dialog marks a page's
30
+ * subsection; a row scrolls the column to its section. A press leaves the
31
+ * focus where it was; a row chosen from the keyboard (Return or Space on
32
+ * it) moves the focus to its section's first control, so a keyboard user
33
+ * lands where they asked to go. A fixed frame (`.sectioned-dialog`), so the
34
+ * dialog does not resize as its fields change; everything else, the title,
35
+ * the legend and its keys, and Escape, is `ModalDialog`'s.
36
+ */
37
+ export declare function SectionedDialog({ sections, openAt, notice, className, ...dialog }: SectionedDialogProps): ReactElement;
@@ -0,0 +1,158 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useLayoutEffect, useRef, useState } from 'react';
3
+ import { useLabels } from '../labels/UiokProvider.js';
4
+ import { spiedSubsection, subsectionScrollTop } from '../shell/SettingsDialog.logic.js';
5
+ import { cutTooltip } from '../tooltip/Tooltip.logic.js';
6
+ import { ModalDialog } from './ModalDialog.js';
7
+ /** The attribute that marks a section of a `SectionedDialog`'s body, carrying its id. */
8
+ const SECTION_ATTRIBUTE = 'data-dialog-section';
9
+ /** What can take the focus inside a section: its first control, for a section chosen from the keyboard. */
10
+ const FOCUSABLE = 'input:not([type="hidden"]), select, textarea, button, [href], [tabindex]';
11
+ /**
12
+ * Moves the focus to the first control of `section` that Tab would stop on
13
+ * and that takes it: one in the Tab order (a row's control out of it, at
14
+ * `tabIndex` -1, is the cursor row's keys' to run), not disabled (by itself
15
+ * or a disabled fieldset), not hidden, and, should the browser still refuse
16
+ * one, the next. So Tab goes on from it as the dialog's Tab cycle expects.
17
+ * Returns the control it focused, null for none.
18
+ */
19
+ const focusFirstControl = (section) => {
20
+ for (const control of section.querySelectorAll(FOCUSABLE)) {
21
+ if (control.tabIndex < 0 ||
22
+ control.matches(':disabled') ||
23
+ control.closest('[hidden], [inert]') !== null) {
24
+ continue;
25
+ }
26
+ control.focus({ preventScroll: true });
27
+ if (control.ownerDocument.activeElement === control)
28
+ return control;
29
+ }
30
+ return null;
31
+ };
32
+ /**
33
+ * Where each section starts in the column, in pixels from the top of its
34
+ * scrolled content.
35
+ */
36
+ const sectionAnchors = (column) => {
37
+ const columnTop = column.getBoundingClientRect().top - column.scrollTop;
38
+ return [...column.querySelectorAll(`[${SECTION_ATTRIBUTE}]`)].map((section) => ({
39
+ id: section.getAttribute(SECTION_ATTRIBUTE) ?? '',
40
+ top: section.getBoundingClientRect().top - columnTop
41
+ }));
42
+ };
43
+ /** A press on a sidebar row leaves the focus where it was, as a list row's does. */
44
+ const keepFocus = (event) => event.preventDefault();
45
+ /**
46
+ * A form too long for one view (a command's settings, a connection's
47
+ * options), in a dialog with a sidebar of its sections beside a column that
48
+ * scrolls: each section's name heads its group as an overline, a hairline
49
+ * between groups. The sidebar marks the section in view and follows the
50
+ * column as it scrolls, the way the Settings dialog marks a page's
51
+ * subsection; a row scrolls the column to its section. A press leaves the
52
+ * focus where it was; a row chosen from the keyboard (Return or Space on
53
+ * it) moves the focus to its section's first control, so a keyboard user
54
+ * lands where they asked to go. A fixed frame (`.sectioned-dialog`), so the
55
+ * dialog does not resize as its fields change; everything else, the title,
56
+ * the legend and its keys, and Escape, is `ModalDialog`'s.
57
+ */
58
+ export function SectionedDialog({ sections, openAt, notice, className, ...dialog }) {
59
+ const labels = useLabels().dialog;
60
+ const prefix = useId();
61
+ // The scrolling column, as state: a dialog under a `DialogLayer` mounts
62
+ // its frame only once the layer's element exists, after this component's
63
+ // first commit, so the effects below wait for the column, not the mount.
64
+ const [column, setColumn] = useState(null);
65
+ // Set while the column scrolls to the section a sidebar row chose, so that
66
+ // scroll keeps the choice marked even where the column cannot bring it to
67
+ // the top (a short last section).
68
+ const chosenScrollRef = useRef(false);
69
+ const [current, setCurrent] = useState(openAt ?? sections[0]?.id ?? null);
70
+ const openAtRef = useRef(openAt);
71
+ const spy = (column) => {
72
+ setCurrent(spiedSubsection(sectionAnchors(column), column));
73
+ };
74
+ // Scrolls the column to a chosen section, keeping the scroll it causes from
75
+ // moving the mark off it.
76
+ const scrollTo = (column, id) => {
77
+ const top = subsectionScrollTop(sectionAnchors(column), id);
78
+ if (top === null)
79
+ return;
80
+ const before = column.scrollTop;
81
+ column.scrollTop = top;
82
+ chosenScrollRef.current = column.scrollTop !== before;
83
+ };
84
+ const show = (id, focus) => {
85
+ setCurrent(id);
86
+ if (column === null)
87
+ return;
88
+ scrollTo(column, id);
89
+ if (focus) {
90
+ const section = [...column.querySelectorAll(`[${SECTION_ATTRIBUTE}]`)].find((candidate) => candidate.getAttribute(SECTION_ATTRIBUTE) === id);
91
+ const control = section === undefined ? null : focusFirstControl(section);
92
+ // A control past the column's end (a long list above it in its
93
+ // section) comes into view, the scroll keeping the section marked.
94
+ if (control !== null) {
95
+ const view = column.getBoundingClientRect();
96
+ const box = control.getBoundingClientRect();
97
+ if (box.top < view.top || box.bottom > view.bottom) {
98
+ const before = column.scrollTop;
99
+ // Optional: an engine with no scrollIntoView (jsdom) only focuses.
100
+ control.scrollIntoView?.({ block: 'nearest' });
101
+ chosenScrollRef.current = chosenScrollRef.current || column.scrollTop !== before;
102
+ }
103
+ }
104
+ }
105
+ };
106
+ // Opens on the section asked for, or marks the one in view, once the
107
+ // column is in the document.
108
+ useLayoutEffect(() => {
109
+ const first = openAtRef.current;
110
+ if (column === null)
111
+ return;
112
+ if (first === undefined) {
113
+ spy(column);
114
+ }
115
+ else {
116
+ scrollTo(column, first);
117
+ }
118
+ // Runs once per column: a later openAt does not scroll an open dialog.
119
+ }, [column]);
120
+ // A section that grows or shrinks as it is filled in (a dependency added)
121
+ // moves the one in view without a scroll, so the mark follows the content.
122
+ useLayoutEffect(() => {
123
+ if (column === null || typeof MutationObserver === 'undefined')
124
+ return undefined;
125
+ const observer = new MutationObserver(() => {
126
+ if (!chosenScrollRef.current)
127
+ spy(column);
128
+ });
129
+ observer.observe(column, { childList: true, subtree: true });
130
+ return () => observer.disconnect();
131
+ }, [column]);
132
+ const classes = className === undefined ? 'sectioned-dialog' : `sectioned-dialog ${className}`;
133
+ return (_jsx(ModalDialog, { ...dialog, className: classes, children: _jsxs("div", { className: "sectioned-dialog-body", children: [_jsx("nav", { "aria-label": labels.sections, className: "sectioned-dialog-nav scroll-fade", children: sections.map((section) => (_jsx("button", { "aria-controls": `${prefix}-${section.id}`, "aria-current": section.id === current ? 'location' : undefined, className: "sectioned-dialog-nav-row", onClick: (event) => show(section.id, event.detail === 0),
134
+ // Return on a row goes to its section, as Space does, instead
135
+ // of running the dialog's primary verb, which plain Return
136
+ // runs from anywhere else in the dialog.
137
+ onKeyDown: (event) => {
138
+ if (event.key !== 'Enter' ||
139
+ event.nativeEvent.isComposing ||
140
+ event.repeat ||
141
+ event.altKey ||
142
+ event.ctrlKey ||
143
+ event.metaKey ||
144
+ event.shiftKey) {
145
+ return;
146
+ }
147
+ event.preventDefault();
148
+ event.stopPropagation();
149
+ show(section.id, true);
150
+ }, onMouseDown: keepFocus, type: "button", ...cutTooltip(section.title), children: section.title }, section.id))) }), _jsxs("div", { className: "sectioned-dialog-column", children: [notice, _jsx("div", { className: "sectioned-dialog-sections scroll-fade", onScroll: (event) => {
151
+ if (chosenScrollRef.current) {
152
+ chosenScrollRef.current = false;
153
+ }
154
+ else {
155
+ spy(event.currentTarget);
156
+ }
157
+ }, ref: setColumn, children: sections.map((section) => (_jsxs("section", { "aria-labelledby": `${prefix}-${section.id}-title`, className: "dialog-section", id: `${prefix}-${section.id}`, [SECTION_ATTRIBUTE]: section.id, children: [_jsx("h3", { className: "dialog-section-title overline", id: `${prefix}-${section.id}-title`, children: section.title }), section.children] }, section.id))) })] })] }) }));
158
+ }
@@ -423,6 +423,108 @@
423
423
  font-weight: var(--font-weight-strong);
424
424
  }
425
425
 
426
+ /* ---- Sectioned dialog (SectionedDialog) ----
427
+
428
+ A form too long for one view: a sidebar of its sections beside a column
429
+ that scrolls, both reaching the frame's edges from the title strip's rule
430
+ down to the legend's hairline. A fixed frame, so the dialog keeps its
431
+ size as fields come and go, that fits the smallest window. */
432
+ .dialog.sectioned-dialog {
433
+ width: min(860px, 100%);
434
+ height: min(640px, 100%);
435
+ }
436
+
437
+ .sectioned-dialog-body {
438
+ display: grid;
439
+ grid-template-columns: minmax(140px, 170px) minmax(0, 1fr);
440
+ flex: 1 1 auto;
441
+ min-height: 0;
442
+ margin: calc(-1 * var(--space-6));
443
+ }
444
+
445
+ /* The sidebar, a shade over the dialog's surface; the hairline beside it
446
+ is the column's, since its own edge fade would mask one of its own. */
447
+ .sectioned-dialog-nav {
448
+ display: flex;
449
+ flex-direction: column;
450
+ gap: var(--space-1);
451
+ overflow-y: auto;
452
+ padding: var(--space-4);
453
+ background: var(--scrim-strong);
454
+ }
455
+
456
+ /* A section's row: the Settings sidebar's row, its hover and press the
457
+ base sheet's quiet recipes. */
458
+ .sectioned-dialog-nav-row {
459
+ display: block;
460
+ width: 100%;
461
+ min-height: var(--bar-height);
462
+ margin: 0;
463
+ padding: calc((var(--bar-height) - var(--line-height-compact)) / 2) var(--space-4);
464
+ overflow: hidden;
465
+ border: 0;
466
+ border-radius: var(--radius-md);
467
+ background: none;
468
+ color: var(--text-dim);
469
+ cursor: default;
470
+ font: var(--font-weight-regular) var(--font-size-small) / var(--line-height-compact)
471
+ var(--font-ui);
472
+ text-align: start;
473
+ text-overflow: ellipsis;
474
+ white-space: nowrap;
475
+ }
476
+
477
+ .sectioned-dialog-nav-row:focus-visible {
478
+ outline-offset: var(--focus-offset-inset);
479
+ }
480
+
481
+ /* The section in view: the current item's tint and ring, its words full. */
482
+ .sectioned-dialog-nav-row[aria-current='location'] {
483
+ background: var(--current-bg);
484
+ box-shadow: inset 0 0 0 var(--line) var(--current-ring);
485
+ color: var(--text);
486
+ }
487
+
488
+ /* The column: a failed save's notice, which never scrolls, over the
489
+ sections, which do, fading at an edge while more lies past it. */
490
+ .sectioned-dialog-column {
491
+ display: flex;
492
+ flex-direction: column;
493
+ min-width: 0;
494
+ min-height: 0;
495
+ border-inline-start: var(--line) solid var(--border);
496
+ }
497
+
498
+ .sectioned-dialog-column > .notice {
499
+ flex: none;
500
+ padding: var(--space-4) var(--space-8) 0;
501
+ }
502
+
503
+ .sectioned-dialog-sections {
504
+ flex: 1 1 auto;
505
+ min-width: 0;
506
+ min-height: 0;
507
+ overflow-y: auto;
508
+ padding: var(--space-6) var(--space-8) var(--space-8);
509
+ }
510
+
511
+ /* Each section a group under its overline, a hairline between them. */
512
+ .dialog-section {
513
+ padding: var(--space-8) 0;
514
+ }
515
+
516
+ .dialog-section:first-child {
517
+ padding-top: 0;
518
+ }
519
+
520
+ .dialog-section + .dialog-section {
521
+ border-top: var(--line) solid var(--border);
522
+ }
523
+
524
+ .dialog-section > .dialog-section-title {
525
+ margin: 0 0 var(--space-6);
526
+ }
527
+
426
528
  /* ---- Fact list (DialogFacts) ----
427
529
 
428
530
  A desktop property list: one line per row, the labels in a leading
@@ -4,12 +4,14 @@
4
4
  * lists a confirmation's body holds (`DialogItems` for what it acts on,
5
5
  * `DialogStatements` for the statements it runs, `DialogFacts` for facts
6
6
  * about the action), the `ProgressDialog` of long work, the
7
- * `TypedNameDialog` for work a slip would cost most, and the
8
- * `DialogLayer` a host mounts them into.
7
+ * `TypedNameDialog` for work a slip would cost most, the
8
+ * `SectionedDialog` of a form too long for one view, and the `DialogLayer` a
9
+ * host mounts them into.
9
10
  */
10
11
  export { ConfirmDialog, type ConfirmDialogProps, type ConfirmTone } from './ConfirmDialog.js';
11
12
  export { DialogLayer, type DialogLayerProps } from './DialogLayer.js';
12
13
  export { ProgressDialog, type ProgressDialogProps } from './ProgressDialog.js';
14
+ export { SectionedDialog, type DialogSection, type SectionedDialogProps } from './SectionedDialog.js';
13
15
  export { TypedNameDialog, type TypedNameDialogProps } from './TypedNameDialog.js';
14
16
  export { DIALOG_ITEMS_SHOWN, DialogFacts, DialogItems, DialogStatements, shownItems, type DialogFact, type DialogFactsProps, type DialogItem, type DialogItemGroup, type DialogItemsProps, type DialogStatementsProps } from './DialogLists.js';
15
17
  export { DialogLegend, type DialogLegendProps } from './DialogLegend.js';
@@ -4,12 +4,14 @@
4
4
  * lists a confirmation's body holds (`DialogItems` for what it acts on,
5
5
  * `DialogStatements` for the statements it runs, `DialogFacts` for facts
6
6
  * about the action), the `ProgressDialog` of long work, the
7
- * `TypedNameDialog` for work a slip would cost most, and the
8
- * `DialogLayer` a host mounts them into.
7
+ * `TypedNameDialog` for work a slip would cost most, the
8
+ * `SectionedDialog` of a form too long for one view, and the `DialogLayer` a
9
+ * host mounts them into.
9
10
  */
10
11
  export { ConfirmDialog } from './ConfirmDialog.js';
11
12
  export { DialogLayer } from './DialogLayer.js';
12
13
  export { ProgressDialog } from './ProgressDialog.js';
14
+ export { SectionedDialog } from './SectionedDialog.js';
13
15
  export { TypedNameDialog } from './TypedNameDialog.js';
14
16
  export { DIALOG_ITEMS_SHOWN, DialogFacts, DialogItems, DialogStatements, shownItems } from './DialogLists.js';
15
17
  export { DialogLegend } from './DialogLegend.js';
@@ -120,7 +120,8 @@ export interface FieldGroupProps {
120
120
  readonly problem?: ReactNode;
121
121
  }
122
122
  /**
123
- * A group of choices under its legend, 4px apart, or in `columns`. Draws
124
- * `fieldset.field-group` (`.field-columns`).
123
+ * A group of choices under its legend, 4px apart, or in `columns`, described
124
+ * by its problem and note (`aria-describedby`); a `note` or `problem` of
125
+ * `false` draws nothing. Draws `fieldset.field-group` (`.field-columns`).
125
126
  */
126
127
  export declare function FieldGroup({ legend, legendHidden, children, columns, note, problem }: FieldGroupProps): ReactElement;
@@ -79,11 +79,16 @@ export function FieldProblem({ children, id }) {
79
79
  return (_jsx("p", { className: "field-problem", id: id, children: children }));
80
80
  }
81
81
  /**
82
- * A group of choices under its legend, 4px apart, or in `columns`. Draws
83
- * `fieldset.field-group` (`.field-columns`).
82
+ * A group of choices under its legend, 4px apart, or in `columns`, described
83
+ * by its problem and note (`aria-describedby`); a `note` or `problem` of
84
+ * `false` draws nothing. Draws `fieldset.field-group` (`.field-columns`).
84
85
  */
85
86
  export function FieldGroup({ legend, legendHidden = false, children, columns, note, problem }) {
86
87
  const made = useId();
87
88
  const hasProblem = problem !== undefined && problem !== null && problem !== false;
88
- return (_jsxs("fieldset", { "aria-describedby": hasProblem ? `${made}-problem` : undefined, className: columns === undefined ? 'field-group' : 'field-group field-columns', style: columns === undefined ? undefined : { '--field-columns': columns }, children: [_jsx("legend", { className: legendHidden ? 'visually-hidden' : undefined, children: legend }), children, hasProblem ? _jsx(FieldProblem, { id: `${made}-problem`, children: problem }) : null, note === undefined || note === null ? null : _jsx(FieldNote, { children: note })] }));
89
+ const hasNote = note !== undefined && note !== null && note !== false;
90
+ const describedBy = [hasProblem ? `${made}-problem` : '', hasNote ? `${made}-note` : '']
91
+ .filter(Boolean)
92
+ .join(' ');
93
+ return (_jsxs("fieldset", { "aria-describedby": describedBy || undefined, className: columns === undefined ? 'field-group' : 'field-group field-columns', style: columns === undefined ? undefined : { '--field-columns': columns }, children: [_jsx("legend", { className: legendHidden ? 'visually-hidden' : undefined, children: legend }), children, hasProblem ? _jsx(FieldProblem, { id: `${made}-problem`, children: problem }) : null, hasNote ? _jsx(FieldNote, { id: `${made}-note`, children: note }) : null] }));
89
94
  }
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement, ReactNode, Ref } from 'react';
2
- import type { RegionHandlers } from '../pane/Pane.js';
2
+ import { type RegionHandlers } from '../pane/Pane.js';
3
3
  /** Props for {@link AppRoot}. */
4
4
  export interface AppRootProps {
5
5
  /**
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { regionHandlers } from '../pane/Pane.js';
2
3
  /**
3
4
  * The app window's root: one column the window's height holding its
4
5
  * content, which owns the whole window, its top band included. A window
@@ -14,7 +15,7 @@ export function AppRoot({ channel = null, children }) {
14
15
  * out of the Tab order, never a control, so it draws no ring.
15
16
  */
16
17
  export function SpacePanel({ ref, children, ...handlers }) {
17
- return (_jsx("div", { className: "space-panel", ref: ref, tabIndex: -1, ...handlers, children: children }));
18
+ return (_jsx("div", { className: "space-panel", ref: ref, tabIndex: -1, ...regionHandlers(handlers), children: children }));
18
19
  }
19
20
  /**
20
21
  * One page of the main pane: the front tab's page lays out as the pane's
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement, type ReactNode, type Ref } from 'react';
2
- import type { RegionHandlers } from '../pane/Pane.js';
2
+ import { type RegionHandlers } from '../pane/Pane.js';
3
3
  /**
4
4
  * The height a dock takes: the height its host keeps, between `min` and
5
5
  * the room under the band less what the main pane keeps (`pageMin`), in
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Children, useLayoutEffect, useState } from 'react';
3
+ import { regionHandlers } from '../pane/Pane.js';
3
4
  import { useSharedRef } from './sharedRef.js';
4
5
  import { drawn } from './WindowFrame.js';
5
6
  /**
@@ -107,7 +108,7 @@ export function Dock({ open, label, height, pageMin = 160, active = false, tone,
107
108
  const classes = ['pane', 'window-dock', active ? 'active' : '', open ? '' : 'closed']
108
109
  .filter(Boolean)
109
110
  .join(' ');
110
- return (_jsxs("section", { "aria-label": label, className: classes, "data-tone": tone, ref: attach, style: { height: shown }, ...handlers, children: [onResize === undefined ? null : (_jsx("div", { "aria-label": resizeLabel, "aria-orientation": "horizontal", className: "pane-splitter", onPointerDown: start, role: "separator" })), drawn(bar) ? _jsx("div", { className: "dock-bar", children: bar }) : null, _jsx("div", { className: "dock-body", children: children })] }));
111
+ return (_jsxs("section", { "aria-label": label, className: classes, "data-tone": tone, ref: attach, style: { height: shown }, ...regionHandlers(handlers), children: [onResize === undefined ? null : (_jsx("div", { "aria-label": resizeLabel, "aria-orientation": "horizontal", className: "pane-splitter", onPointerDown: start, role: "separator" })), drawn(bar) ? _jsx("div", { className: "dock-bar", children: bar }) : null, _jsx("div", { className: "dock-body", children: children })] }));
111
112
  }
112
113
  /**
113
114
  * A dock's log: its entries over a hairline each, the newest at the foot;
@@ -1,5 +1,5 @@
1
1
  import type { LucideIcon } from 'lucide-react';
2
- import type { ReactElement } from 'react';
2
+ import { type ReactElement } from 'react';
3
3
  /** One filter of a quick row. */
4
4
  export interface FilterChip<Id extends string> {
5
5
  readonly id: Id;
@@ -23,6 +23,9 @@ export interface FilterChipsProps<Id extends string> {
23
23
  * A pane's quick row of filters under its path bar (`pane-quick-row`), as a
24
24
  * sidebar's Running and Updates: each a quiet button with its glyph, its
25
25
  * word, and its count, pressed while on. A press toggles its filter and
26
- * leaves the focus where it was.
26
+ * leaves the focus where it was. The row is one line: chips that do not
27
+ * fit scroll sideways under an edge fade (`.scroll-fade-x`), a mouse's
28
+ * vertical wheel scrolls it sideways while it can move that way
29
+ * (`sidewaysWheel`), and a chip the keys reach comes whole into view.
27
30
  */
28
31
  export declare function FilterChips<Id extends string>({ chips, on, onToggle, label }: FilterChipsProps<Id>): ReactElement;