@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
@@ -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)
package/dist/styles.css CHANGED
@@ -221,6 +221,37 @@ meter::-webkit-meter-even-less-good-value {
221
221
  backdrop-filter: var(--frost);
222
222
  }
223
223
 
224
+ /* The inline direction as inherited properties, for what a logical property
225
+ cannot say: --scroll-fade-inline-to, where the inline fade's gradient runs
226
+ (below), and --inline-flip, 1 or -1, a scaleX() that turns a glyph to
227
+ point toward the inline end. Each explicit dir attribute sets them, so the
228
+ nearest one wins, an LTR box inside an RTL one included; a reader gives
229
+ the left-to-right value as its fallback for a page with no dir attribute.
230
+ An explicit dir is read by attribute, not :dir(rtl): a bundler's CSS
231
+ transform (Lightning CSS, under Vite) rewrites :dir() into a list of
232
+ :lang() selectors, which a right-to-left box in an English page does not
233
+ match. Only dir="auto", whose direction comes from its text, needs
234
+ :dir(); scoped to it, a rewrite can reach no explicit dir. */
235
+ [dir='rtl'] {
236
+ --scroll-fade-inline-to: to left;
237
+ --inline-flip: -1;
238
+ }
239
+
240
+ [dir='ltr'] {
241
+ --scroll-fade-inline-to: to right;
242
+ --inline-flip: 1;
243
+ }
244
+
245
+ [dir='auto']:dir(rtl) {
246
+ --scroll-fade-inline-to: to left;
247
+ --inline-flip: -1;
248
+ }
249
+
250
+ [dir='auto']:dir(ltr) {
251
+ --scroll-fade-inline-to: to right;
252
+ --inline-flip: 1;
253
+ }
254
+
224
255
  /* A scrolling box whose content runs past an edge fades over the last
225
256
  --scroll-fade-size at that edge, so a clipped row reads as "more", not
226
257
  as a cut. On the scrolling element itself: .scroll-fade for the block
@@ -284,11 +315,14 @@ meter::-webkit-meter-even-less-good-value {
284
315
  animation-timeline: scroll(self block);
285
316
  }
286
317
 
318
+ /* The inline fade runs from the inline start, where the scroll timeline
319
+ starts: the left edge, or the right in a right-to-left box, whose
320
+ scroll position counts down from its right edge. */
287
321
  .scroll-fade-x {
288
322
  mask-image:
289
323
  linear-gradient(var(--ground), var(--ground)), linear-gradient(var(--ground), var(--ground)),
290
324
  linear-gradient(
291
- to right,
325
+ var(--scroll-fade-inline-to, to right),
292
326
  transparent,
293
327
  var(--ground) var(--scroll-fade-inline-start),
294
328
  var(--ground) calc(100% - var(--scroll-fade-inline-end)),
@@ -320,7 +354,7 @@ meter::-webkit-meter-even-less-good-value {
320
354
  transparent
321
355
  ),
322
356
  linear-gradient(
323
- to right,
357
+ var(--scroll-fade-inline-to, to right),
324
358
  transparent,
325
359
  var(--ground) var(--scroll-fade-inline-start),
326
360
  var(--ground) calc(100% - var(--scroll-fade-inline-end)),
@@ -333,7 +367,7 @@ meter::-webkit-meter-even-less-good-value {
333
367
  linear-gradient(var(--ground), var(--ground)), linear-gradient(var(--ground), var(--ground)),
334
368
  linear-gradient(to bottom, var(--ground) calc(100% - var(--scroll-fade-end)), transparent),
335
369
  linear-gradient(
336
- to right,
370
+ var(--scroll-fade-inline-to, to right),
337
371
  transparent,
338
372
  var(--ground) var(--scroll-fade-inline-start),
339
373
  var(--ground) calc(100% - var(--scroll-fade-inline-end)),
@@ -472,6 +506,7 @@ meter::-webkit-meter-even-less-good-value {
472
506
  .palette-level,
473
507
  .settings-sidebar-page,
474
508
  .settings-sidebar-subsection,
509
+ .sectioned-dialog-nav-row,
475
510
  .quiet-control,
476
511
  .quiet-track-item,
477
512
  .toggle-chip
@@ -490,6 +525,7 @@ meter::-webkit-meter-even-less-good-value {
490
525
  .pane-strip-link,
491
526
  .settings-sidebar-page,
492
527
  .settings-sidebar-subsection,
528
+ .sectioned-dialog-nav-row,
493
529
  .quiet-control,
494
530
  .toggle-chip
495
531
  ):where(button, a[href], [role='button'], [role='tab'], [role='radio']):where(
@@ -551,6 +587,7 @@ meter::-webkit-meter-even-less-good-value {
551
587
  .disclosure,
552
588
  .settings-sidebar-page,
553
589
  .settings-sidebar-subsection,
590
+ .sectioned-dialog-nav-row,
554
591
  .quiet-control,
555
592
  .quiet-track-item,
556
593
  .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
+ }
@@ -1,10 +1,13 @@
1
1
  /**
2
2
  * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
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; `GroupSwatch`, a group'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
5
7
  * colour beside its name; and `Tag`, a small worded tag in a tone.
6
8
  */
7
9
  export { Card, type CardProps } from './Card.js';
10
+ export { Fact, FactColumns, FactList, type FactColumnsProps, type FactListProps, type FactProps, type FactValueTone } from './FactList.js';
8
11
  export { FactRow, FactTable, type FactRowProps, type FactTableProps, type FactTone } from './FactTable.js';
9
12
  export { Notice, type NoticeProps, type NoticeTone } from './Notice.js';
10
13
  export { GroupSwatch, type GroupSwatchProps } from './GroupSwatch.js';
@@ -1,10 +1,13 @@
1
1
  /**
2
2
  * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
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; `GroupSwatch`, a group'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
5
7
  * colour beside its name; and `Tag`, a small worded tag in a tone.
6
8
  */
7
9
  export { Card } from './Card.js';
10
+ export { Fact, FactColumns, FactList } from './FactList.js';
8
11
  export { FactRow, FactTable } from './FactTable.js';
9
12
  export { Notice } from './Notice.js';
10
13
  export { GroupSwatch } from './GroupSwatch.js';
@@ -126,12 +126,13 @@
126
126
  problem (.field-problem), a listing's refusal (.pane-message.danger),
127
127
  and a palette's failure note (.palette-failure) lead with the danger
128
128
  tone's CircleAlert, drawn as a mask in --danger, so they read as the same status line a notice is, words in --text. A host
129
- that draws its own glyph first (an svg) gets no second one. */
129
+ that draws its own glyph first (an svg, inside a PaneMessage's words
130
+ too) gets no second one. */
130
131
  :is(
131
132
  .field-problem,
132
133
  :where(.listing-root) .pane-message.danger,
133
134
  :where(.palette-notes) .palette-failure
134
- ):not(:has(> svg:first-child))::before {
135
+ ):not(:has(> svg:first-child, > .pane-message-text > svg:first-child))::before {
135
136
  content: '';
136
137
  flex: none;
137
138
  width: var(--icon-md);
@@ -331,3 +332,85 @@
331
332
  font-variant-numeric: tabular-nums;
332
333
  white-space: nowrap;
333
334
  }
335
+
336
+ /* ---- Fact list (FactList, Fact, FactColumns) ----
337
+
338
+ A headed list of facts set straight on a page: the overline, then one
339
+ name and value a line, the names in a column of their own (as wide as
340
+ the longest, up to two fifths of the list) in the dim interface face,
341
+ the values beside them in the code face in --text. A long value wraps
342
+ whole as a block beside its name, so its next lines start under its
343
+ first and never under the name; a printed value (`.printed`) keeps its
344
+ line breaks and spaces. The words are content, so they can be swept and
345
+ copied. */
346
+ .fact-list {
347
+ min-width: 0;
348
+ }
349
+
350
+ .fact-list > .fact-list-title {
351
+ margin: 0 0 var(--space-4);
352
+ }
353
+
354
+ .fact-list-items {
355
+ display: grid;
356
+ grid-template-columns: fit-content(40%) minmax(0, 1fr);
357
+ column-gap: var(--space-8);
358
+ row-gap: var(--space-2);
359
+ margin: 0;
360
+ font: var(--font-size-small) / var(--line-height-compact) var(--font-ui);
361
+ -webkit-user-select: text;
362
+ user-select: text;
363
+ }
364
+
365
+ .fact-list-item {
366
+ display: grid;
367
+ grid-column: 1 / -1;
368
+ grid-template-columns: subgrid;
369
+ align-items: baseline;
370
+ }
371
+
372
+ .fact-list-name {
373
+ min-width: 0;
374
+ color: var(--text-dim);
375
+ overflow-wrap: break-word;
376
+ }
377
+
378
+ .fact-list-value {
379
+ min-width: 0;
380
+ margin: 0;
381
+ color: var(--text);
382
+ font-family: var(--font-mono);
383
+ overflow-wrap: anywhere;
384
+ }
385
+
386
+ .fact-list-value.printed {
387
+ white-space: pre-wrap;
388
+ }
389
+
390
+ .fact-list-item[data-tone='danger'] > .fact-list-value {
391
+ color: var(--danger-text);
392
+ }
393
+
394
+ .fact-list-item[data-tone='warning'] > .fact-list-value {
395
+ color: var(--warning-text);
396
+ }
397
+
398
+ /* Lists side by side, as many columns of one width as fit (at least
399
+ 26 characters of the interface face each), the lists of a row starting
400
+ on one line, a row's tallest setting where the next row starts. */
401
+ .fact-columns {
402
+ display: grid;
403
+ grid-template-columns: repeat(auto-fill, minmax(min(26em, 100%), 1fr));
404
+ gap: var(--space-8) var(--space-12);
405
+ align-items: start;
406
+ }
407
+
408
+ /* Set straight in a pane's body (a PaneList, a PanePage, a PageSlot, which
409
+ draws no box of its own, or one part of a SideBySide), a list of facts
410
+ or a row of them keeps the rows' inset from the pane's edge, where a
411
+ section head, a pane message, and a row's icon start, and a step of room
412
+ above and below. Nested in a row of lists, or inside a card, it is the
413
+ container's to inset. */
414
+ :is(.pane-list, .pane-page, .page-slot, .side-by-side-part) > :is(.fact-list, .fact-columns) {
415
+ padding: var(--space-4) var(--pane-row-inset);
416
+ }
@@ -89,6 +89,6 @@ export function TerminalMenu({ at, within, items, label, onRun, onClose }) {
89
89
  : 'folder-menu-option terminal-menu-item', id: `${itemId}-${index}`, onClick: () => run(item), onMouseMove: () => {
90
90
  if (item.enabled)
91
91
  setPointed(item.verb);
92
- }, role: "menuitem", children: [_jsx("span", { className: "terminal-menu-icon", children: _jsx(Icon, { "aria-hidden": true, size: ICON_MD }) }), _jsx("span", { className: "terminal-menu-label", children: item.label }), _jsx(KeyChord, { chord: item.chord })] }, item.verb));
92
+ }, role: "menuitem", children: [_jsx("span", { className: "terminal-menu-icon", children: _jsx(Icon, { "aria-hidden": true, size: ICON_MD }) }), _jsx("span", { className: "terminal-menu-label", children: item.label }), ' ', _jsx(KeyChord, { chord: item.chord })] }, item.verb));
93
93
  }) }), document.fullscreenElement ?? document.body);
94
94
  }
@@ -4,10 +4,18 @@
4
4
  * ABI into plain values. Every handle is freed by `dispose`.
5
5
  */
6
6
  /**
7
- * How many terminals one page's shared engine memory is budgeted for: sixteen
8
- * interactive terminals and one read-only log. Every terminal on a page
9
- * shares one WebAssembly memory, which wasm32 caps at 4 GiB, so each
10
- * terminal's history ceiling is a share of it.
7
+ * How many terminals one page is budgeted for (17: sixteen interactive
8
+ * terminals and one read-only log), exported as `BUDGETED_TERMINALS_PER_PAGE`.
9
+ * Every terminal on a page shares one WebAssembly memory, which wasm32 caps
10
+ * at 4 GiB, so each terminal's history ceiling is this share of 3 GiB: up to
11
+ * this many terminals, every history may fill to its ceiling and the shared
12
+ * memory still holds. A page may show more, but past this count the
13
+ * guarantee is gone: should enough of them fill their histories to the
14
+ * ceiling (50,000 lines on a grid wider than about 445 columns), the shared
15
+ * memory runs out and the engine cannot allocate. At ordinary lengths a
16
+ * history stays far under its ceiling (about 7.4 MiB for 10,000 lines at 80
17
+ * columns), so an app that opens a terminal per tab can test its own limit
18
+ * against this count.
11
19
  */
12
20
  export declare const GHOSTTY_BUDGETED_TERMINALS = 17;
13
21
  /** Ghostty's cell width classes: a wide glyph's second column is its spacer tail. */
@@ -7,10 +7,18 @@ import { ghosttyConsumedMods, ghosttyKeyForCode, ghosttyUnshiftedCodepoint } fro
7
7
  import { GhosttyRuntime, loadGhosttyRuntime } from './runtime.js';
8
8
  import { ENGINE_DEFAULT_BACKGROUND, ENGINE_DEFAULT_FOREGROUND } from './fallbackColors.js';
9
9
  /**
10
- * How many terminals one page's shared engine memory is budgeted for: sixteen
11
- * interactive terminals and one read-only log. Every terminal on a page
12
- * shares one WebAssembly memory, which wasm32 caps at 4 GiB, so each
13
- * terminal's history ceiling is a share of it.
10
+ * How many terminals one page is budgeted for (17: sixteen interactive
11
+ * terminals and one read-only log), exported as `BUDGETED_TERMINALS_PER_PAGE`.
12
+ * Every terminal on a page shares one WebAssembly memory, which wasm32 caps
13
+ * at 4 GiB, so each terminal's history ceiling is this share of 3 GiB: up to
14
+ * this many terminals, every history may fill to its ceiling and the shared
15
+ * memory still holds. A page may show more, but past this count the
16
+ * guarantee is gone: should enough of them fill their histories to the
17
+ * ceiling (50,000 lines on a grid wider than about 445 columns), the shared
18
+ * memory runs out and the engine cannot allocate. At ordinary lengths a
19
+ * history stays far under its ceiling (about 7.4 MiB for 10,000 lines at 80
20
+ * columns), so an app that opens a terminal per tab can test its own limit
21
+ * against this count.
14
22
  */
15
23
  export const GHOSTTY_BUDGETED_TERMINALS = 17;
16
24
  const GHOSTTY_SUCCESS = 0;
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
3
3
  * canvas, with its Copy and Paste menu, `TerminalBox` (a framed console of
4
- * a fixed height, or one that fills its parent), and the scrollback length every
5
- * terminal under `TerminalScrollbackContext` keeps. Imported on its own as
4
+ * a fixed height, or one that fills its parent), the scrollback length every
5
+ * terminal under `TerminalScrollbackContext` keeps, and how many terminals
6
+ * one page's shared engine memory is budgeted for. Imported on its own as
6
7
  * `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
7
8
  * that shows no terminal never loads the engine; its look is terminal.css,
8
9
  * which the base stylesheet imports.
@@ -12,3 +13,4 @@ export { TERMINAL_BOX_HEIGHT, TerminalBox, type TerminalBoxProps } from './Termi
12
13
  export { type TerminalAction, type TerminalKeyStroke } from './Terminal.logic.js';
13
14
  export { DEFAULT_TERMINAL_MENU_CHORDS, type TerminalMenuChords } from './TerminalMenu.logic.js';
14
15
  export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
16
+ export { GHOSTTY_BUDGETED_TERMINALS as BUDGETED_TERMINALS_PER_PAGE } from './ghostty/core.js';
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
3
3
  * canvas, with its Copy and Paste menu, `TerminalBox` (a framed console of
4
- * a fixed height, or one that fills its parent), and the scrollback length every
5
- * terminal under `TerminalScrollbackContext` keeps. Imported on its own as
4
+ * a fixed height, or one that fills its parent), the scrollback length every
5
+ * terminal under `TerminalScrollbackContext` keeps, and how many terminals
6
+ * one page's shared engine memory is budgeted for. Imported on its own as
6
7
  * `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
7
8
  * that shows no terminal never loads the engine; its look is terminal.css,
8
9
  * which the base stylesheet imports.
@@ -12,3 +13,4 @@ export { TERMINAL_BOX_HEIGHT, TerminalBox } from './TerminalBox.js';
12
13
  export {} from './Terminal.logic.js';
13
14
  export { DEFAULT_TERMINAL_MENU_CHORDS } from './TerminalMenu.logic.js';
14
15
  export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
16
+ export { GHOSTTY_BUDGETED_TERMINALS as BUDGETED_TERMINALS_PER_PAGE } from './ghostty/core.js';
@@ -195,7 +195,8 @@
195
195
  }
196
196
 
197
197
  /* A terminal in a box of its own (TerminalBox). Framed, it is a console of
198
- a fixed height (--terminal-box-height, which the component sets) in the
198
+ a fixed height (--terminal-box-height, which the component sets, else
199
+ --terminal-box-default-height, 200px, for a box drawn by class alone) in the
199
200
  strong hairline a well wears, on the terminal's ground; filling, it
200
201
  takes its parent's room with no frame. Either way it pads the mount by
201
202
  the 8px every host adds, so the text starts 12px in. */
@@ -203,7 +204,7 @@
203
204
  display: flex;
204
205
  flex: none;
205
206
  min-width: 0;
206
- height: var(--terminal-box-height);
207
+ height: var(--terminal-box-height, var(--terminal-box-default-height));
207
208
  padding: var(--space-4);
208
209
  overflow: hidden;
209
210
  border: var(--line) solid var(--border-strong);
@@ -0,0 +1,15 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /** Props for {@link Code}. */
3
+ export interface CodeProps {
4
+ /** The command, path, name, or value, as the user would type or see it: `brew services list`. */
5
+ readonly children: ReactNode;
6
+ }
7
+ /**
8
+ * A command, a path, or a name inside a sentence (a note, a field's help,
9
+ * a notice): the code face at the size of the words round it, on a faint
10
+ * track with rounded ends, in the text tone, so it reads as something to
11
+ * type or find, never as a link. A long one wraps anywhere, each line
12
+ * keeping its padding and ends. It can be swept and copied with the
13
+ * sentence. Draws `code.inline-code`.
14
+ */
15
+ export declare function Code({ children }: CodeProps): ReactElement;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * A command, a path, or a name inside a sentence (a note, a field's help,
4
+ * a notice): the code face at the size of the words round it, on a faint
5
+ * track with rounded ends, in the text tone, so it reads as something to
6
+ * type or find, never as a link. A long one wraps anywhere, each line
7
+ * keeping its padding and ends. It can be swept and copied with the
8
+ * sentence. Draws `code.inline-code`.
9
+ */
10
+ export function Code({ children }) {
11
+ return _jsx("code", { className: "inline-code", children: children });
12
+ }
@@ -1,3 +1,8 @@
1
- /** Marked text: `MarkedText` tints the characters a match hit, from the runs `highlightSegments` splits. */
1
+ /**
2
+ * Text parts: `MarkedText` tints the characters a match hit, from the runs
3
+ * `highlightSegments` splits; `Code` sets a command or a path inside a
4
+ * sentence.
5
+ */
6
+ export { Code, type CodeProps } from './Code.js';
2
7
  export { highlightSegments, type HighlightSegment } from './highlightSegments.js';
3
8
  export { MarkedText, type MarkedTextProps } from './MarkedText.js';
@@ -1,3 +1,8 @@
1
- /** Marked text: `MarkedText` tints the characters a match hit, from the runs `highlightSegments` splits. */
1
+ /**
2
+ * Text parts: `MarkedText` tints the characters a match hit, from the runs
3
+ * `highlightSegments` splits; `Code` sets a command or a path inside a
4
+ * sentence.
5
+ */
6
+ export { Code } from './Code.js';
2
7
  export { highlightSegments } from './highlightSegments.js';
3
8
  export { MarkedText } from './MarkedText.js';
@@ -18,3 +18,24 @@
18
18
  background: var(--match-bg);
19
19
  box-shadow: inset 0 calc(-1 * var(--line-strong)) 0 var(--match-mark);
20
20
  }
21
+
22
+ /* ---- Inline code (Code) ----
23
+
24
+ A command, a path, or a name inside a sentence: the code face at the
25
+ size of the words round it, on the control track's faint wash, in the
26
+ text tone (never the accent, which reads as a link). It wraps anywhere,
27
+ and each line of a wrapped one keeps its padding and its rounded ends.
28
+ It is content, so a user can sweep and copy it. */
29
+ .inline-code {
30
+ padding: 0 var(--space-2);
31
+ border-radius: var(--radius-xs);
32
+ background: var(--control-track);
33
+ color: var(--text);
34
+ font-family: var(--font-mono);
35
+ font-size: inherit;
36
+ overflow-wrap: anywhere;
37
+ -webkit-box-decoration-break: clone;
38
+ box-decoration-break: clone;
39
+ -webkit-user-select: text;
40
+ user-select: text;
41
+ }
@@ -1097,8 +1097,8 @@ function rule(selector, tokens, depth = 0) {
1097
1097
  * declares or reads (the activity stripes' colour, a dialog's tone, top
1098
1098
  * inset, and pinned top, a date picker fraction field's digit count, a tab
1099
1099
  * strip's edge fades, a field's label column and chevron, a range's fill, a
1100
- * notice's tone, the scroll fade's edges), which an app token on `:root`
1101
- * would otherwise reach.
1100
+ * notice's tone, the scroll fade's edges, the inline direction's flip),
1101
+ * which an app token on `:root` would otherwise reach.
1102
1102
  */
1103
1103
  const BASE_TOKEN_NAMES = [
1104
1104
  // The scales of src/tokens.css: size, space, corner, line, timing,
@@ -1156,6 +1156,7 @@ const BASE_TOKEN_NAMES = [
1156
1156
  '--shell-header-height',
1157
1157
  '--traffic-light-inset',
1158
1158
  '--sidebar-width',
1159
+ '--terminal-box-default-height',
1159
1160
  '--focus-ring-width',
1160
1161
  '--focus-offset',
1161
1162
  '--focus-offset-flush',
@@ -1178,12 +1179,16 @@ const BASE_TOKEN_NAMES = [
1178
1179
  '--z-tooltip',
1179
1180
  '--frost',
1180
1181
  '--transition-control',
1181
- // The scroll fade's edge size and its internal per-edge lengths.
1182
+ // The scroll fade's edge size, its internal per-edge lengths, and the
1183
+ // inline fade's direction.
1182
1184
  '--scroll-fade-size',
1183
1185
  '--scroll-fade-start',
1184
1186
  '--scroll-fade-end',
1185
1187
  '--scroll-fade-inline-start',
1186
1188
  '--scroll-fade-inline-end',
1189
+ '--scroll-fade-inline-to',
1190
+ // The inline direction each dir attribute sets for what a logical property cannot say.
1191
+ '--inline-flip',
1187
1192
  // The hooks a component stylesheet declares or reads.
1188
1193
  '--stripe-ink',
1189
1194
  '--stripe-ground',
package/dist/tokens.css CHANGED
@@ -144,6 +144,10 @@
144
144
  --traffic-light-inset: 72px;
145
145
  --sidebar-width: 240px;
146
146
 
147
+ /* A framed terminal's height when its host gives none (TerminalBox, whose
148
+ TERMINAL_BOX_HEIGHT it matches): a dialog's console, ten lines and some. */
149
+ --terminal-box-default-height: 200px;
150
+
147
151
  /* Focus. One ring for everything focusable: a 2px accent line outside the
148
152
  control at focus-offset, so it follows the control's corner one pixel
149
153
  out. focus-offset-flush puts it on the control's edge, for a compact