@bigpixelrocket/uiok 0.0.0-stage → 0.1.1

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 (280) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +569 -0
  4. package/README.md +44 -2
  5. package/dist/VisuallyHidden.d.ts +13 -0
  6. package/dist/VisuallyHidden.js +13 -0
  7. package/dist/activity/ActivityBar.d.ts +29 -0
  8. package/dist/activity/ActivityBar.js +21 -0
  9. package/dist/activity/activity.css +43 -0
  10. package/dist/activity/index.d.ts +2 -0
  11. package/dist/activity/index.js +2 -0
  12. package/dist/button/Button.d.ts +26 -0
  13. package/dist/button/Button.js +14 -0
  14. package/dist/button/IconButton.d.ts +18 -0
  15. package/dist/button/IconButton.js +14 -0
  16. package/dist/button/button.css +95 -0
  17. package/dist/button/index.d.ts +3 -0
  18. package/dist/button/index.js +3 -0
  19. package/dist/charts/Drawing.d.ts +27 -0
  20. package/dist/charts/Drawing.js +117 -0
  21. package/dist/charts/Drawing.logic.d.ts +2 -0
  22. package/dist/charts/Drawing.logic.js +22 -0
  23. package/dist/charts/Line.logic.d.ts +33 -0
  24. package/dist/charts/Line.logic.js +72 -0
  25. package/dist/charts/LineChart.d.ts +34 -0
  26. package/dist/charts/LineChart.js +100 -0
  27. package/dist/charts/Pie.logic.d.ts +16 -0
  28. package/dist/charts/Pie.logic.js +28 -0
  29. package/dist/charts/PieChart.d.ts +20 -0
  30. package/dist/charts/PieChart.js +16 -0
  31. package/dist/charts/ResultChart.d.ts +47 -0
  32. package/dist/charts/ResultChart.js +175 -0
  33. package/dist/charts/ResultChart.logic.d.ts +42 -0
  34. package/dist/charts/ResultChart.logic.js +165 -0
  35. package/dist/charts/Scatter.logic.d.ts +55 -0
  36. package/dist/charts/Scatter.logic.js +134 -0
  37. package/dist/charts/ScatterChart.d.ts +36 -0
  38. package/dist/charts/ScatterChart.js +99 -0
  39. package/dist/charts/charts.css +310 -0
  40. package/dist/charts/index.d.ts +14 -0
  41. package/dist/charts/index.js +11 -0
  42. package/dist/charts/seriesColour.d.ts +2 -0
  43. package/dist/charts/seriesColour.js +8 -0
  44. package/dist/clock/index.d.ts +2 -0
  45. package/dist/clock/index.js +2 -0
  46. package/dist/clock/useClock.d.ts +14 -0
  47. package/dist/clock/useClock.js +57 -0
  48. package/dist/datetime/DateTimePicker.d.ts +50 -0
  49. package/dist/datetime/DateTimePicker.js +98 -0
  50. package/dist/datetime/DateTimePicker.logic.d.ts +59 -0
  51. package/dist/datetime/DateTimePicker.logic.js +103 -0
  52. package/dist/datetime/datetime.css +115 -0
  53. package/dist/datetime/index.d.ts +7 -0
  54. package/dist/datetime/index.js +7 -0
  55. package/dist/dialog/ConfirmDialog.d.ts +73 -0
  56. package/dist/dialog/ConfirmDialog.js +30 -0
  57. package/dist/dialog/DialogLegend.d.ts +21 -0
  58. package/dist/dialog/DialogLegend.js +28 -0
  59. package/dist/dialog/DialogLegend.logic.d.ts +145 -0
  60. package/dist/dialog/DialogLegend.logic.js +71 -0
  61. package/dist/dialog/ModalDialog.d.ts +101 -0
  62. package/dist/dialog/ModalDialog.js +184 -0
  63. package/dist/dialog/dialog.css +283 -0
  64. package/dist/dialog/index.d.ts +8 -0
  65. package/dist/dialog/index.js +8 -0
  66. package/dist/filter/FilterEscape.d.ts +16 -0
  67. package/dist/filter/FilterEscape.js +15 -0
  68. package/dist/filter/FilterIcon.d.ts +8 -0
  69. package/dist/filter/FilterIcon.js +11 -0
  70. package/dist/filter/filter.css +42 -0
  71. package/dist/filter/index.d.ts +3 -0
  72. package/dist/filter/index.js +3 -0
  73. package/dist/grid/DataGrid.d.ts +149 -0
  74. package/dist/grid/DataGrid.js +373 -0
  75. package/dist/grid/DataGrid.logic.d.ts +57 -0
  76. package/dist/grid/DataGrid.logic.js +121 -0
  77. package/dist/grid/grid.css +206 -0
  78. package/dist/grid/index.d.ts +7 -0
  79. package/dist/grid/index.js +7 -0
  80. package/dist/index.d.ts +32 -0
  81. package/dist/index.js +32 -0
  82. package/dist/keyboard/BrowserKeys.d.ts +15 -0
  83. package/dist/keyboard/BrowserKeys.js +28 -0
  84. package/dist/keyboard/KeyChord.logic.d.ts +25 -0
  85. package/dist/keyboard/KeyChord.logic.js +50 -0
  86. package/dist/keyboard/Keyboard.logic.d.ts +84 -0
  87. package/dist/keyboard/Keyboard.logic.js +137 -0
  88. package/dist/keyboard/OverlayWatch.d.ts +28 -0
  89. package/dist/keyboard/OverlayWatch.js +119 -0
  90. package/dist/keyboard/PageSelectAll.d.ts +14 -0
  91. package/dist/keyboard/PageSelectAll.js +22 -0
  92. package/dist/keyboard/index.d.ts +9 -0
  93. package/dist/keyboard/index.js +9 -0
  94. package/dist/keychord/KeyChord.d.ts +16 -0
  95. package/dist/keychord/KeyChord.js +55 -0
  96. package/dist/keychord/index.d.ts +2 -0
  97. package/dist/keychord/index.js +2 -0
  98. package/dist/keychord/keychord.css +41 -0
  99. package/dist/labels/UiokLabels.d.ts +41 -0
  100. package/dist/labels/UiokLabels.js +31 -0
  101. package/dist/labels/UiokProvider.d.ts +44 -0
  102. package/dist/labels/UiokProvider.js +54 -0
  103. package/dist/labels/charts.d.ts +34 -0
  104. package/dist/labels/charts.js +15 -0
  105. package/dist/labels/dateTime.d.ts +32 -0
  106. package/dist/labels/dateTime.js +14 -0
  107. package/dist/labels/dialog.d.ts +18 -0
  108. package/dist/labels/dialog.js +6 -0
  109. package/dist/labels/index.d.ts +13 -0
  110. package/dist/labels/index.js +13 -0
  111. package/dist/labels/keys.d.ts +28 -0
  112. package/dist/labels/keys.js +53 -0
  113. package/dist/labels/legend.d.ts +21 -0
  114. package/dist/labels/legend.js +7 -0
  115. package/dist/labels/listing.d.ts +16 -0
  116. package/dist/labels/listing.js +8 -0
  117. package/dist/labels/pager.d.ts +32 -0
  118. package/dist/labels/pager.js +20 -0
  119. package/dist/labels/palette.d.ts +17 -0
  120. package/dist/labels/palette.js +6 -0
  121. package/dist/labels/selectAll.d.ts +15 -0
  122. package/dist/labels/selectAll.js +6 -0
  123. package/dist/labels/terminal.d.ts +25 -0
  124. package/dist/labels/terminal.js +9 -0
  125. package/dist/legend/KeyLegend.logic.d.ts +84 -0
  126. package/dist/legend/KeyLegend.logic.js +109 -0
  127. package/dist/legend/KeyLegendStrip.d.ts +36 -0
  128. package/dist/legend/KeyLegendStrip.js +82 -0
  129. package/dist/legend/index.d.ts +3 -0
  130. package/dist/legend/index.js +3 -0
  131. package/dist/legend/legend.css +148 -0
  132. package/dist/listing/CurrentDot.d.ts +15 -0
  133. package/dist/listing/CurrentDot.js +13 -0
  134. package/dist/listing/Listing.d.ts +230 -0
  135. package/dist/listing/Listing.js +265 -0
  136. package/dist/listing/PathParts.logic.d.ts +17 -0
  137. package/dist/listing/PathParts.logic.js +18 -0
  138. package/dist/listing/index.d.ts +10 -0
  139. package/dist/listing/index.js +10 -0
  140. package/dist/listing/listing.css +867 -0
  141. package/dist/menu/MenuQuery.logic.d.ts +69 -0
  142. package/dist/menu/MenuQuery.logic.js +75 -0
  143. package/dist/menu/fuzzyMatch.d.ts +31 -0
  144. package/dist/menu/fuzzyMatch.js +296 -0
  145. package/dist/menu/index.d.ts +9 -0
  146. package/dist/menu/index.js +9 -0
  147. package/dist/menu/menu.css +203 -0
  148. package/dist/menu/useBellBeat.d.ts +8 -0
  149. package/dist/menu/useBellBeat.js +26 -0
  150. package/dist/namecut/NameCut.d.ts +22 -0
  151. package/dist/namecut/NameCut.js +28 -0
  152. package/dist/namecut/NameCut.logic.d.ts +51 -0
  153. package/dist/namecut/NameCut.logic.js +120 -0
  154. package/dist/namecut/index.d.ts +3 -0
  155. package/dist/namecut/index.js +3 -0
  156. package/dist/namecut/namecut.css +67 -0
  157. package/dist/pager/Pager.d.ts +37 -0
  158. package/dist/pager/Pager.js +38 -0
  159. package/dist/pager/Pager.logic.d.ts +13 -0
  160. package/dist/pager/Pager.logic.js +63 -0
  161. package/dist/pager/index.d.ts +7 -0
  162. package/dist/pager/index.js +7 -0
  163. package/dist/pager/pager.css +62 -0
  164. package/dist/palette/Palette.d.ts +79 -0
  165. package/dist/palette/Palette.js +60 -0
  166. package/dist/palette/index.d.ts +6 -0
  167. package/dist/palette/index.js +6 -0
  168. package/dist/palette/palette.css +159 -0
  169. package/dist/pane/PaneActions.d.ts +104 -0
  170. package/dist/pane/PaneActions.js +62 -0
  171. package/dist/pane/PaneFrame.d.ts +51 -0
  172. package/dist/pane/PaneFrame.js +28 -0
  173. package/dist/pane/PaneKeys.d.ts +41 -0
  174. package/dist/pane/PaneKeys.js +104 -0
  175. package/dist/pane/PaneKeys.logic.d.ts +95 -0
  176. package/dist/pane/PaneKeys.logic.js +109 -0
  177. package/dist/pane/index.d.ts +11 -0
  178. package/dist/pane/index.js +11 -0
  179. package/dist/pane/usePaneKeys.d.ts +141 -0
  180. package/dist/pane/usePaneKeys.js +313 -0
  181. package/dist/run/RunHeader.d.ts +50 -0
  182. package/dist/run/RunHeader.js +31 -0
  183. package/dist/run/RunProgress.logic.d.ts +29 -0
  184. package/dist/run/RunProgress.logic.js +34 -0
  185. package/dist/run/index.d.ts +3 -0
  186. package/dist/run/index.js +3 -0
  187. package/dist/run/run.css +190 -0
  188. package/dist/segmented/SegmentedChoice.d.ts +22 -0
  189. package/dist/segmented/SegmentedChoice.js +31 -0
  190. package/dist/segmented/index.d.ts +2 -0
  191. package/dist/segmented/index.js +2 -0
  192. package/dist/segmented/segmented.css +49 -0
  193. package/dist/selectall/CheckRange.logic.d.ts +8 -0
  194. package/dist/selectall/CheckRange.logic.js +23 -0
  195. package/dist/selectall/SelectAllBar.d.ts +25 -0
  196. package/dist/selectall/SelectAllBar.js +24 -0
  197. package/dist/selectall/index.d.ts +7 -0
  198. package/dist/selectall/index.js +7 -0
  199. package/dist/selectall/selectall.css +31 -0
  200. package/dist/store/KeepUnchanged.logic.d.ts +19 -0
  201. package/dist/store/KeepUnchanged.logic.js +33 -0
  202. package/dist/store/SameProps.d.ts +15 -0
  203. package/dist/store/SameProps.js +46 -0
  204. package/dist/store/ValueStore.d.ts +17 -0
  205. package/dist/store/ValueStore.js +23 -0
  206. package/dist/store/index.d.ts +8 -0
  207. package/dist/store/index.js +8 -0
  208. package/dist/store/useStableHandlers.d.ts +13 -0
  209. package/dist/store/useStableHandlers.js +22 -0
  210. package/dist/styles.css +85 -0
  211. package/dist/tabs/PageTabs.d.ts +38 -0
  212. package/dist/tabs/PageTabs.js +33 -0
  213. package/dist/tabs/index.d.ts +2 -0
  214. package/dist/tabs/index.js +2 -0
  215. package/dist/tabs/tabs.css +64 -0
  216. package/dist/terminal/Terminal.d.ts +104 -0
  217. package/dist/terminal/Terminal.js +309 -0
  218. package/dist/terminal/Terminal.logic.d.ts +66 -0
  219. package/dist/terminal/Terminal.logic.js +156 -0
  220. package/dist/terminal/TerminalMenu.d.ts +36 -0
  221. package/dist/terminal/TerminalMenu.js +87 -0
  222. package/dist/terminal/TerminalMenu.logic.d.ts +78 -0
  223. package/dist/terminal/TerminalMenu.logic.js +68 -0
  224. package/dist/terminal/TerminalScrollback.d.ts +10 -0
  225. package/dist/terminal/TerminalScrollback.js +11 -0
  226. package/dist/terminal/ghostty/LICENSE +21 -0
  227. package/dist/terminal/ghostty/core.d.ts +315 -0
  228. package/dist/terminal/ghostty/core.js +1189 -0
  229. package/dist/terminal/ghostty/fallbackColors.d.ts +12 -0
  230. package/dist/terminal/ghostty/fallbackColors.js +23 -0
  231. package/dist/terminal/ghostty/fonts/LICENSE +21 -0
  232. package/dist/terminal/ghostty/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
  233. package/dist/terminal/ghostty/keyCodes.logic.d.ts +20 -0
  234. package/dist/terminal/ghostty/keyCodes.logic.js +249 -0
  235. package/dist/terminal/ghostty/links.logic.d.ts +39 -0
  236. package/dist/terminal/ghostty/links.logic.js +84 -0
  237. package/dist/terminal/ghostty/renderer.d.ts +98 -0
  238. package/dist/terminal/ghostty/renderer.js +481 -0
  239. package/dist/terminal/ghostty/runtime.d.ts +126 -0
  240. package/dist/terminal/ghostty/runtime.js +346 -0
  241. package/dist/terminal/ghostty/spriteGlyphs.logic.d.ts +64 -0
  242. package/dist/terminal/ghostty/spriteGlyphs.logic.js +546 -0
  243. package/dist/terminal/ghostty/surface.d.ts +285 -0
  244. package/dist/terminal/ghostty/surface.js +1565 -0
  245. package/dist/terminal/ghostty/surface.logic.d.ts +181 -0
  246. package/dist/terminal/ghostty/surface.logic.js +392 -0
  247. package/dist/terminal/ghostty/vendor/LICENSE +21 -0
  248. package/dist/terminal/ghostty/vendor/ghostty-effects.wasm +0 -0
  249. package/dist/terminal/ghostty/vendor/ghostty-vt.wasm +0 -0
  250. package/dist/terminal/index.d.ts +12 -0
  251. package/dist/terminal/index.js +12 -0
  252. package/dist/terminal/terminal.css +169 -0
  253. package/dist/text/MarkedText.d.ts +14 -0
  254. package/dist/text/MarkedText.js +11 -0
  255. package/dist/text/highlightSegments.d.ts +13 -0
  256. package/dist/text/highlightSegments.js +29 -0
  257. package/dist/text/index.d.ts +3 -0
  258. package/dist/text/index.js +3 -0
  259. package/dist/text/text.css +11 -0
  260. package/dist/themes/attributes.d.ts +21 -0
  261. package/dist/themes/attributes.js +41 -0
  262. package/dist/themes/catalog.d.ts +125 -0
  263. package/dist/themes/catalog.js +940 -0
  264. package/dist/themes/color.d.ts +29 -0
  265. package/dist/themes/color.js +52 -0
  266. package/dist/themes/ids.d.ts +139 -0
  267. package/dist/themes/ids.js +59 -0
  268. package/dist/themes/index.d.ts +12 -0
  269. package/dist/themes/index.js +12 -0
  270. package/dist/themes/themes.generated.css +1830 -0
  271. package/dist/themes/tokens.d.ts +189 -0
  272. package/dist/themes/tokens.js +462 -0
  273. package/dist/tooltip/Tooltip.d.ts +21 -0
  274. package/dist/tooltip/Tooltip.js +105 -0
  275. package/dist/tooltip/Tooltip.logic.d.ts +49 -0
  276. package/dist/tooltip/Tooltip.logic.js +50 -0
  277. package/dist/tooltip/index.d.ts +3 -0
  278. package/dist/tooltip/index.js +3 -0
  279. package/dist/tooltip/tooltip.css +45 -0
  280. package/package.json +91 -4
@@ -0,0 +1,36 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { Chord } from '../keyboard/Keyboard.logic.js';
3
+ import { type LegendPair } from './KeyLegend.logic.js';
4
+ /**
5
+ * One verb a key legend strip lists: its label, its chord, what a click on
6
+ * it runs, and the pair of opposite verbs it is one of, if any.
7
+ */
8
+ export interface LegendVerb {
9
+ readonly label: string;
10
+ readonly chord: Chord;
11
+ readonly run: () => void;
12
+ readonly pair?: LegendPair;
13
+ }
14
+ /** Props for {@link KeyLegendStrip}: the verbs in order, and the labels of the pairs among them. */
15
+ export interface KeyLegendStripProps {
16
+ /** The verbs the keyboard offers now, left to right; the strip draws them as given. */
17
+ readonly verbs: readonly LegendVerb[];
18
+ /**
19
+ * The one label a pair's place shows ("Up/Down"), in the language in use.
20
+ * Without it no verbs fold, and each keeps a place of its own.
21
+ */
22
+ readonly pairLabel?: (pair: LegendPair) => string;
23
+ }
24
+ /**
25
+ * A key legend strip along a window's bottom edge: a dock of fn and the four
26
+ * modifiers at the left, lit while held, then the verbs the keyboard offers
27
+ * now, each under its whole chord, since the strip lists every layer at once.
28
+ * Two neighbours that are one action's two directions (↑ Up and ↓ Down)
29
+ * share a place, both key caps and one label (`legendUnits`, `pairLabel`).
30
+ * Every verb is a button that runs it, kept out of the Tab order (the chord
31
+ * is the keyboard's way to it) and leaving the focus where it was. The
32
+ * caller decides which verbs are listed and in which order; the strip draws
33
+ * them. Its own name, its verb group's name, and a paired cap's name come
34
+ * from `UiokLabels.legend`, chords in words from `UiokLabels.keys`.
35
+ */
36
+ export declare function KeyLegendStrip({ verbs, pairLabel }: KeyLegendStripProps): ReactElement;
@@ -0,0 +1,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ArrowBigUp, ChevronUp, Command, Option } from 'lucide-react';
3
+ import { useEffect, useState } from 'react';
4
+ import { chordGlyphs, chordSpoken } from '../keyboard/KeyChord.logic.js';
5
+ import { KeyChord } from '../keychord/KeyChord.js';
6
+ import { useLabels } from '../labels/UiokProvider.js';
7
+ import { tooltip } from '../tooltip/Tooltip.logic.js';
8
+ import { legendUnits } from './KeyLegend.logic.js';
9
+ /** The dock's keys, as they sit at the keyboard's left edge: Shift on its row, then Control, Option, Command. */
10
+ const DOCK = [
11
+ { mod: 'shift', Icon: ArrowBigUp },
12
+ { mod: 'ctrl', Icon: ChevronUp },
13
+ { mod: 'alt', Icon: Option },
14
+ { mod: 'meta', Icon: Command }
15
+ ];
16
+ const NOTHING_HELD = new Set();
17
+ /** Whether a key event says `mod` is down. */
18
+ const isHeld = (event, mod) => mod === 'shift'
19
+ ? event.shiftKey
20
+ : mod === 'ctrl'
21
+ ? event.ctrlKey
22
+ : mod === 'alt'
23
+ ? event.altKey
24
+ : event.metaKey;
25
+ /** The modifiers a key event says are down. */
26
+ const heldBy = (event) => new Set(DOCK.flatMap(({ mod }) => (isHeld(event, mod) ? [mod] : [])));
27
+ /** Whether two sets of modifiers name the same keys. */
28
+ const sameHeld = (a, b) => a.size === b.size && [...a].every((mod) => b.has(mod));
29
+ /**
30
+ * The modifiers the keyboard holds right now, read from every window key
31
+ * down and up, and none once the window loses focus (a Command+Tab away
32
+ * never sends the key up here). A key that leaves the held modifiers as
33
+ * they were keeps the same set, so the strip draws nothing again for it.
34
+ */
35
+ function useHeldModifiers() {
36
+ const [held, setHeld] = useState(NOTHING_HELD);
37
+ useEffect(() => {
38
+ const read = (event) => {
39
+ const next = heldBy(event);
40
+ setHeld((current) => (sameHeld(current, next) ? current : next));
41
+ };
42
+ const release = () => setHeld(NOTHING_HELD);
43
+ window.addEventListener('keydown', read);
44
+ window.addEventListener('keyup', read);
45
+ window.addEventListener('blur', release);
46
+ return () => {
47
+ window.removeEventListener('keydown', read);
48
+ window.removeEventListener('keyup', read);
49
+ window.removeEventListener('blur', release);
50
+ };
51
+ }, []);
52
+ return held;
53
+ }
54
+ /** Keeps the focus where it was on a press, so a click on a slot leaves the keys where they were. */
55
+ const keepFocus = (event) => event.preventDefault();
56
+ /** For a strip given no pair labels: no verb is read as one of a pair, so no label is asked for. */
57
+ const UNPAIRED = { pairLabel: (pair) => pair, pairOf: () => undefined };
58
+ /**
59
+ * A key legend strip along a window's bottom edge: a dock of fn and the four
60
+ * modifiers at the left, lit while held, then the verbs the keyboard offers
61
+ * now, each under its whole chord, since the strip lists every layer at once.
62
+ * Two neighbours that are one action's two directions (↑ Up and ↓ Down)
63
+ * share a place, both key caps and one label (`legendUnits`, `pairLabel`).
64
+ * Every verb is a button that runs it, kept out of the Tab order (the chord
65
+ * is the keyboard's way to it) and leaving the focus where it was. The
66
+ * caller decides which verbs are listed and in which order; the strip draws
67
+ * them. Its own name, its verb group's name, and a paired cap's name come
68
+ * from `UiokLabels.legend`, chords in words from `UiokLabels.keys`.
69
+ */
70
+ export function KeyLegendStrip({ verbs, pairLabel }) {
71
+ const { keys, legend } = useLabels();
72
+ const held = useHeldModifiers();
73
+ const units = legendUnits(verbs, pairLabel === undefined ? UNPAIRED : { pairLabel });
74
+ const place = (unit) => {
75
+ const [first, second] = unit.entries;
76
+ if (second === undefined) {
77
+ return (_jsxs("button", { onClick: first.run, onMouseDown: keepFocus, tabIndex: -1, type: "button", children: [_jsx(KeyChord, { chord: first.chord }), " ", first.label] }, first.label + chordGlyphs(first.chord, keys)));
78
+ }
79
+ return (_jsxs("span", { className: "keylegend-pair", children: [unit.entries.map((entry) => (_jsx("button", { "aria-label": legend.capName(chordSpoken(entry.chord, keys), entry.label), className: "keylegend-cap", onClick: entry.run, onMouseDown: keepFocus, tabIndex: -1, type: "button", ...tooltip(entry.label, chordGlyphs(entry.chord, keys)), children: _jsx(KeyChord, { chord: entry.chord }) }, entry.chord.key))), _jsx("span", { "aria-hidden": true, className: "keylegend-pair-label", children: unit.label })] }, unit.label + chordGlyphs(first.chord, keys)));
80
+ };
81
+ return (_jsxs("footer", { "aria-label": legend.label, className: "keylegend", "data-fn": "false", "data-layer": "none", children: [_jsxs("span", { "aria-hidden": true, className: "keylegend-dock", children: [_jsx("span", { className: "keylegend-key keylegend-dock-fn", children: "fn" }), DOCK.map(({ mod, Icon }) => (_jsx("span", { className: held.has(mod) ? 'keylegend-key held' : 'keylegend-key', children: _jsx(Icon, { className: "key-icon" }) }, mod)))] }), _jsx("span", { className: "keylegend-row", children: _jsx("span", { "aria-label": legend.verbs, className: "keylegend-verbs", role: "group", children: units.map(place) }) })] }));
82
+ }
@@ -0,0 +1,3 @@
1
+ /** The key legend: `KeyLegendStrip` and the pairing, fitting, and overflow rules any legend can use. */
2
+ export { fittingUnits, legendUnits, moreLabel, moreListAction, type LegendPair, type LegendUnit, type LegendUnitOptions, type MoreListAction, type Pairable } from './KeyLegend.logic.js';
3
+ export { KeyLegendStrip, type KeyLegendStripProps, type LegendVerb } from './KeyLegendStrip.js';
@@ -0,0 +1,3 @@
1
+ /** The key legend: `KeyLegendStrip` and the pairing, fitting, and overflow rules any legend can use. */
2
+ export { fittingUnits, legendUnits, moreLabel, moreListAction } from './KeyLegend.logic.js';
3
+ export { KeyLegendStrip } from './KeyLegendStrip.js';
@@ -0,0 +1,148 @@
1
+ /* ---- Key legend (KeyLegendStrip) ----
2
+
3
+ The strip along a window's bottom edge that names what the keyboard does
4
+ now. Unscoped: a legend drawn inside the listing scope (.listing-root)
5
+ weighs the same as one outside it. */
6
+
7
+ /* The key legend: the verbs as one row. A dock of fn and the four
8
+ modifiers, drawn as keys, holds the left edge: a held key fills with the
9
+ accent. The verbs follow from a fixed left edge, so the first slot never
10
+ moves. */
11
+ .keylegend {
12
+ position: relative;
13
+ display: flex;
14
+ align-items: center;
15
+ height: 34px;
16
+ flex: 0 0 34px;
17
+ padding: 0 8px 0 10px;
18
+ border-top: 1px solid var(--border);
19
+ background: var(--surface-header);
20
+ }
21
+
22
+ /* The verbs take what the dock leaves. */
23
+ .keylegend-row {
24
+ display: flex;
25
+ align-items: center;
26
+ flex: 1;
27
+ min-width: 0;
28
+ }
29
+
30
+ .keylegend-dock {
31
+ display: inline-flex;
32
+ gap: 3px;
33
+ margin-right: 12px;
34
+ padding-right: 12px;
35
+ border-right: 1px solid var(--border-strong);
36
+ }
37
+
38
+ /* The dock only shows what is held, so its keys are drawn as keys, not
39
+ buttons: no pointer, and a fixed box whatever the glyph. */
40
+ .keylegend-dock .keylegend-key {
41
+ display: inline-flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ box-sizing: border-box;
45
+ width: 24px;
46
+ height: 20px;
47
+ padding: 0;
48
+ border: 1px solid var(--border-strong);
49
+ border-bottom-width: 2px;
50
+ border-radius: 4px;
51
+ background: var(--bg-panel);
52
+ color: var(--text-dim);
53
+ cursor: default;
54
+ }
55
+
56
+ .keylegend-dock .keylegend-key .key-icon {
57
+ width: 12px;
58
+ height: 12px;
59
+ }
60
+
61
+ .keylegend-dock .keylegend-key.held {
62
+ background: var(--accent);
63
+ border-color: var(--accent);
64
+ color: var(--on-accent);
65
+ }
66
+
67
+ /* The fn key sits first in the dock, where a laptop keyboard prints it; it
68
+ is wider than the modifier glyphs because it is a word. */
69
+ .keylegend-dock .keylegend-dock-fn {
70
+ width: 28px;
71
+ font: 11px var(--font-mono);
72
+ }
73
+
74
+ .keylegend-verbs button:focus-visible {
75
+ outline: 2px solid var(--accent);
76
+ outline-offset: 1px;
77
+ }
78
+
79
+ .keylegend-verbs {
80
+ display: flex;
81
+ align-items: center;
82
+ flex: 1;
83
+ min-width: 0;
84
+ overflow: hidden;
85
+ }
86
+
87
+ .keylegend-verbs button {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ gap: 6px;
91
+ height: 24px;
92
+ padding: 0 7px 0 4px;
93
+ background: none;
94
+ border: none;
95
+ border-radius: 5px;
96
+ color: var(--text);
97
+ font: inherit;
98
+ font-size: 12px;
99
+ white-space: nowrap;
100
+ cursor: pointer;
101
+ }
102
+
103
+ .keylegend-verbs button:hover:enabled:not([aria-disabled='true']) {
104
+ background: var(--hover-wash);
105
+ box-shadow: var(--hover-frost);
106
+ }
107
+
108
+ /* Two directions of one action in one slot: each key cap is its own button,
109
+ lit alone under the pointer, and the shared label is not a target. The
110
+ caps keep a plain slot's spacing: 4px in, 6px apart, 6px to the label. */
111
+ .keylegend-pair {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ height: 24px;
115
+ padding: 0 7px 0 1px;
116
+ color: var(--text);
117
+ font-size: 12px;
118
+ white-space: nowrap;
119
+ }
120
+
121
+ .keylegend-verbs .keylegend-cap {
122
+ gap: 0;
123
+ padding: 0 3px;
124
+ }
125
+
126
+ .keylegend-pair-label {
127
+ margin-left: 3px;
128
+ }
129
+
130
+ .keylegend .keychord {
131
+ height: 18px;
132
+ min-width: 20px;
133
+ justify-content: center;
134
+ padding: 0 4px;
135
+ border-radius: 4px;
136
+ color: var(--accent);
137
+ background: color-mix(in srgb, var(--accent) 14%, transparent);
138
+ }
139
+
140
+ /* At rest the caps are drawn as plain keys. A legend that shows one layer
141
+ at a time sets data-layer to the held modifier, and data-fn while fn is
142
+ held, so its caps take the accent with the layer. */
143
+ .keylegend[data-layer='none']:not([data-fn='true']) .keychord {
144
+ box-sizing: border-box;
145
+ color: var(--text);
146
+ background: var(--bg-panel);
147
+ border: 1px solid var(--border-strong);
148
+ }
@@ -0,0 +1,15 @@
1
+ import type { ReactElement } from 'react';
2
+ /** Props for {@link CurrentDot}. */
3
+ export interface CurrentDotProps {
4
+ /** What current means here ("Open folder", "Default version"), as its name and tooltip. */
5
+ readonly label: string;
6
+ }
7
+ /**
8
+ * The mark of the current one in a list: the folder a pane shows, the disk
9
+ * it is on, the default version of a runtime. A small neutral dot one
10
+ * character after the row's label, never at the row's far end, which holds
11
+ * the row's controls and tags. Neutral, because a coloured dot is a status
12
+ * (a service running, failing, or busy). `label` says what current means
13
+ * here, to the pointer as a tooltip and to a screen reader as its name.
14
+ */
15
+ export declare function CurrentDot({ label }: CurrentDotProps): ReactElement;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { tooltip } from '../tooltip/Tooltip.logic.js';
3
+ /**
4
+ * The mark of the current one in a list: the folder a pane shows, the disk
5
+ * it is on, the default version of a runtime. A small neutral dot one
6
+ * character after the row's label, never at the row's far end, which holds
7
+ * the row's controls and tags. Neutral, because a coloured dot is a status
8
+ * (a service running, failing, or busy). `label` says what current means
9
+ * here, to the pointer as a tooltip and to a screen reader as its name.
10
+ */
11
+ export function CurrentDot({ label }) {
12
+ return _jsx("span", { "aria-label": label, className: "current-dot", role: "img", ...tooltip(label) });
13
+ }
@@ -0,0 +1,230 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import type { SortDirection } from '../labels/listing.js';
3
+ import { type LinkLook } from '../pane/PaneActions.js';
4
+ /**
5
+ * A listing column as wide as `ch` characters and the gutter before it, for
6
+ * a listing's `grid`: `column(9)` is "calc(9ch + var(--pane-column-gap))".
7
+ */
8
+ export declare const column: (ch: number) => string;
9
+ /** The width every listing's action column takes, so actions line up from one listing to the next. */
10
+ export declare const ACTION_COLUMN: string;
11
+ /** A row control drawn as its icon alone (`.pane-icon-act`), in pixels. */
12
+ export declare const ICON_LINK_PX = 22;
13
+ /**
14
+ * A listing column of `count` row controls drawn as icons alone
15
+ * (`RowIconAction`), `gapPx` apart, with the gutter before it, so they never reach over the column
16
+ * before them.
17
+ */
18
+ export declare const iconLinksColumn: (count: number, gapPx: number) => string;
19
+ /**
20
+ * A listing column of row links as `look` draws them (`RowLinkLookContext`):
21
+ * `icons`, the column as it holds them as icons, unchanged; in words, room
22
+ * for each of `words` (the verbs of the row that names the most) and
23
+ * `extraPx` more for the controls beside them that never take words (a
24
+ * favorite's star, a menu), with the gutter before it, so the links never
25
+ * reach over the columns beside them.
26
+ */
27
+ export declare const linksColumn: (look: LinkLook, icons: string, words: readonly string[], extraPx?: number) => string;
28
+ /**
29
+ * How a strip label sorts its listing: the way it sorts by the column now
30
+ * (null for another column), and what a press does, which its caller
31
+ * decides (the other way, or this column first).
32
+ */
33
+ export interface ColumnSort {
34
+ readonly direction: SortDirection;
35
+ readonly onSort: () => void;
36
+ }
37
+ /** One column after the name in a listing's strip. */
38
+ export interface ListingColumn {
39
+ /** The label over the column, and its key. */
40
+ readonly label: string;
41
+ /** The label is for screen readers only, as over an action column. */
42
+ readonly hidden?: boolean;
43
+ readonly align?: 'right';
44
+ /** A control at the strip's right end in the label's place (Update all, Clear). */
45
+ readonly control?: ReactNode;
46
+ /** The label sorts the listing by its column. */
47
+ readonly sort?: ColumnSort;
48
+ }
49
+ /** Props for {@link Strip}. */
50
+ export interface StripProps {
51
+ /** The section's name, the first label. */
52
+ readonly title: string;
53
+ readonly columns?: readonly ListingColumn[];
54
+ /** The strip is a table's header row (`role="row"`, column headers). */
55
+ readonly table?: boolean;
56
+ /** The name is the section's heading (`h3`). */
57
+ readonly heading?: boolean;
58
+ readonly className?: string;
59
+ /** The name's column sorts the listing, under `titleLabel` ("Database"). */
60
+ readonly titleSort?: ColumnSort;
61
+ /** The first column's label, independently of sorting and the table's name. */
62
+ readonly titleLabel?: string;
63
+ }
64
+ /**
65
+ * The ruled column strip a listing opens with: the section's name, then a
66
+ * label over each column. Its labels are text, but for a column that sorts
67
+ * its listing (`sort`, and `titleSort` for the name's column), whose label is
68
+ * the control that sorts it, named by `listing.sortBy` from the labels. In a
69
+ * table (`table`) it is the header row; `heading` makes the name the
70
+ * section's heading. Every visible label carries its whole text as its
71
+ * tooltip, since a narrow column cuts it with an ellipsis.
72
+ */
73
+ export declare function Strip({ title, columns, table, heading, className, titleSort, titleLabel }: StripProps): ReactElement;
74
+ /** Props for {@link Listing}. */
75
+ export interface ListingProps {
76
+ /** The strip's first label, the section's name ("Lines"). */
77
+ readonly title: string;
78
+ /** The table's accessible name, when it says more than the title ("PostgreSQL lines"). */
79
+ readonly label?: string;
80
+ /**
81
+ * The listing's `--pane-grid`: the icon column, the name, then one track
82
+ * per column (`column(ch)`, `ACTION_COLUMN`). A function of the row links'
83
+ * look (`linksColumn`) lets the links step down to a plainer look when
84
+ * their words would make the listing wider than its pane.
85
+ */
86
+ readonly grid: string | ((look: LinkLook) => string);
87
+ readonly columns: readonly ListingColumn[];
88
+ readonly className?: string;
89
+ /** What to say in place of the rows when there are none; null draws the rows. */
90
+ readonly empty?: string | null;
91
+ /** The name's column sorts the listing (`Strip`). */
92
+ readonly titleSort?: ColumnSort;
93
+ /** The first column's label, independently of sorting and the table's name. */
94
+ readonly titleLabel?: string;
95
+ /** The rows (`Row`). */
96
+ readonly children?: ReactNode;
97
+ }
98
+ /**
99
+ * A listing: a table in the listing look (under `.listing-root`), full
100
+ * bleed in its pane, under a ruled column strip whose first label is
101
+ * `titleLabel`, or the section's name when omitted. `grid` is the listing's
102
+ * `--pane-grid`, shared by the strip and every row, so each label sits over
103
+ * its column; a listing whose row links take words gives it as the grid for
104
+ * a look (`linksColumn`), and its rows take the richest look that keeps it
105
+ * inside its pane. A listing with no rows says so in `empty`: a plain line
106
+ * under the strip instead of a table, so no column headers stand over a row
107
+ * that is not one.
108
+ */
109
+ export declare function Listing({ title, label, grid, columns, className, empty, titleSort, titleLabel, children }: ListingProps): ReactElement;
110
+ /**
111
+ * A pane's cursor row, which the app keeps for the page shown
112
+ * (`usePaneKeys` gives one): the keys move it, and the pointer moving over a row or the focus entering it
113
+ * puts it there, so the pointer and the keys share one cursor. `point`
114
+ * moves it to a row by key. Each row follows it through `subscribe` and
115
+ * `current`, so a move draws only the row it leaves and the row it lands
116
+ * on, never the page around them.
117
+ */
118
+ export interface RowCursor {
119
+ /** The cursor row's key now, or null for none. */
120
+ readonly current: () => string | null;
121
+ /** Hears each move; returns the way to stop. */
122
+ readonly subscribe: (listener: () => void) => () => void;
123
+ readonly point: (key: string) => void;
124
+ /**
125
+ * A row came or went, called by each row as it mounts and unmounts, so an
126
+ * app that reads its page's rows (a legend's ↑ ↓) reads them again
127
+ * though only the page drew, as a page reading its own listing does.
128
+ */
129
+ readonly rowsChanged?: () => void;
130
+ }
131
+ /** The cursor of the pane a row is in, which the app provides; without one no row is the cursor. */
132
+ export declare const RowCursorContext: import("react").Context<RowCursor>;
133
+ /** Props for {@link Row}. */
134
+ export interface RowProps {
135
+ /** Names the row to the cursor (`data-row-key`); unique in its pane. */
136
+ readonly rowKey: string;
137
+ /** The icon before the name, decorative. */
138
+ readonly mark?: ReactNode;
139
+ readonly name: ReactNode;
140
+ /** The name cell's own class, beside `row-name`. */
141
+ readonly nameClass?: string;
142
+ readonly className?: string;
143
+ /** Opens the row's item on a click anywhere but its controls. */
144
+ readonly onOpen?: () => void;
145
+ /** Its controls stay in the Tab order. */
146
+ readonly tabbable?: boolean;
147
+ /** The row itself takes the focus: in the Tab order while it is the cursor row. */
148
+ readonly focusable?: boolean;
149
+ /** A focusable row in the Tab order though it is not the cursor row: its listing's way in while none is. */
150
+ readonly entry?: boolean;
151
+ /** The cells after the name (`Cell`). */
152
+ readonly children?: ReactNode;
153
+ }
154
+ /**
155
+ * One row of a listing: its mark, its name, then its cells. `rowKey` names
156
+ * it to the pane's cursor (`RowCursorContext`), which it wears as the
157
+ * listing's cursor row (`.cursor`, `aria-current`); the pointer moving over
158
+ * it or the focus entering it moves the cursor there. A row with `onOpen`
159
+ * opens its item on a click anywhere but its controls. Controls that say
160
+ * what the keys run mark it with `data-verb` (`QuietAction`,
161
+ * `RowIconAction`), and the app reads them off the cursor row
162
+ * (`verbControl`); such controls leave the Tab order, unless `tabbable`
163
+ * keeps them in it, for a listing whose rows no key runs. A `focusable` row
164
+ * is a stop of its own: the cursor row in the Tab order (or, while no row
165
+ * is, the one marked `entry`), the others reached by the keys that move it.
166
+ */
167
+ export declare function Row({ rowKey, mark, name, nameClass, className, onOpen, tabbable, focusable, entry, children }: RowProps): ReactElement;
168
+ /** Props for {@link Cell}. */
169
+ export interface CellProps {
170
+ /** Right-aligned, for numbers. */
171
+ readonly align?: 'right';
172
+ readonly className?: string;
173
+ /** The cell's whole text, for one cut short, as its tooltip and description; none when null. */
174
+ readonly tip?: string | null;
175
+ readonly children?: ReactNode;
176
+ }
177
+ /** A cell of a row after its name, in the listing's metadata look (`.row-meta`). */
178
+ export declare function Cell({ align, className, tip, children }: CellProps): ReactElement;
179
+ /** The tone of a state: ready, a warning, a failure, a transition under way, or quiet. */
180
+ export type StateTone = 'ready' | 'warning' | 'danger' | 'busy' | 'muted';
181
+ /** Props for {@link StateMark}. */
182
+ export interface StateMarkProps {
183
+ readonly tone: StateTone;
184
+ /** The state in words ("running", "error"). */
185
+ readonly word: string;
186
+ /** A transition under way: a spinner in place of the dot. */
187
+ readonly busy?: boolean;
188
+ }
189
+ /**
190
+ * A state as a State column says it: a dot in the state's tone and its word
191
+ * ("running", "error"), or a spinner for a transition. Inside a row the word
192
+ * takes the tone too, so a failure reads red and a stopped line dim.
193
+ */
194
+ export declare function StateMark({ tone, word, busy }: StateMarkProps): ReactElement;
195
+ /** Props for {@link PathCell}. */
196
+ export interface PathCellProps {
197
+ /** The whole path, slash-separated ("/opt/homebrew/var/mysql"). */
198
+ readonly path: string;
199
+ /**
200
+ * The name's own class, which colours it by its kind (a folder as a
201
+ * folder); the text tone without one. `pathParts(path).base` is the name.
202
+ */
203
+ readonly nameClassName?: string;
204
+ }
205
+ /**
206
+ * A path cell: its folders in the row-meta tone, the head giving way first
207
+ * so the ellipsis falls inside it, then the last folder, then the name, in
208
+ * the text tone or the colour `nameClassName` gives it; the whole path in
209
+ * its tooltip.
210
+ */
211
+ export declare function PathCell({ path, nameClassName }: PathCellProps): ReactElement;
212
+ /** Props for {@link WellColumn}. */
213
+ export interface WellColumnProps {
214
+ /** The strip's first label ("Log", "Output"). */
215
+ readonly title: string;
216
+ /** What the strip says at its right end: a file name, a note, or a control (Clear). */
217
+ readonly columns: readonly ListingColumn[];
218
+ /** Names the column as a region; it is a plain block without one. */
219
+ readonly label?: string;
220
+ readonly className?: string;
221
+ /** The well: a `<pre className="pane-well">` of lines, or a terminal in a box. */
222
+ readonly children: ReactNode;
223
+ }
224
+ /**
225
+ * A column that holds a terminal well under its strip: a log or a
226
+ * process's output, full height in the terminal theme's colours (the
227
+ * well, `.pane-well`, is the child's to draw: a `<pre>` of lines, or a
228
+ * terminal in a box). It is a region when `label` names it.
229
+ */
230
+ export declare function WellColumn({ title, columns, label, className, children }: WellColumnProps): ReactElement;