@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,137 @@
1
+ /*
2
+ * Browser-keyboard policy for an app that owns its keys: which keystrokes
3
+ * keep the browser's document behaviour (reload, find, history, page
4
+ * scroll) away from the page, which controls keep their native editing
5
+ * keys, and the overlay selectors every modal surface and menu shares.
6
+ */
7
+ const NON_TEXT_INPUT_TYPES = new Set([
8
+ 'button',
9
+ 'checkbox',
10
+ 'color',
11
+ 'file',
12
+ 'hidden',
13
+ 'image',
14
+ 'radio',
15
+ 'range',
16
+ 'reset',
17
+ 'submit'
18
+ ]);
19
+ const BROWSER_DOCUMENT_COMMAND_KEYS = new Set(['f', 'g', 'p', 'r', 's', 'u']);
20
+ const BROWSER_HISTORY_KEYS = new Set(['[', ']', 'ArrowLeft', 'ArrowRight']);
21
+ const BROWSER_SCROLL_KEYS = new Set([' ', 'PageUp', 'PageDown', 'Home', 'End']);
22
+ /**
23
+ * Any open modal dialog or palette, whoever drew it: the ARIA contract every
24
+ * modal surface shares (`isModalOpen`). Part of UIOK's public contract: a
25
+ * surface that holds the window's keys sets `aria-modal="true"`, and an app
26
+ * reads this selector to know one is open. Changing it is a breaking change.
27
+ */
28
+ export const MODAL_SELECTOR = '[aria-modal="true"]';
29
+ /**
30
+ * Any open overlay Escape closes: every modal surface (`MODAL_SELECTOR`), and
31
+ * the overlays that leave the window's other keys alone, which carry
32
+ * `data-overlay` instead (a menu, a find bar, a picker popover, a folded
33
+ * list of verbs). While one is open, an app should let Escape close it and
34
+ * hold back a window-level close such as ⌘W (`isOverlayOpen`). Part of
35
+ * UIOK's public contract; changing it is a breaking change.
36
+ */
37
+ export const OVERLAY_SELECTOR = `${MODAL_SELECTOR}, [data-overlay]`;
38
+ const hasUnmodifiedCommand = (key) => key.metaKey && !key.ctrlKey && !key.altKey;
39
+ const hasOptionCommand = (key) => key.metaKey && !key.ctrlKey && key.altKey;
40
+ /** True only for plain Cmd+A, without a second modifier. */
41
+ function isCommandSelectAll(key) {
42
+ return hasUnmodifiedCommand(key) && !key.shiftKey && key.key.toLowerCase() === 'a';
43
+ }
44
+ /** Whether a key target is a control where native text selection is intentionally available. */
45
+ export function isTextEditingTarget(target) {
46
+ if (!(target instanceof Element)) {
47
+ return false;
48
+ }
49
+ const input = target.closest('input');
50
+ if (input instanceof HTMLInputElement) {
51
+ return !NON_TEXT_INPUT_TYPES.has(input.type);
52
+ }
53
+ if (target.closest('textarea') instanceof HTMLTextAreaElement) {
54
+ return true;
55
+ }
56
+ const contentEditable = target.closest('[contenteditable]');
57
+ const setting = contentEditable?.getAttribute('contenteditable')?.toLowerCase();
58
+ return setting === '' || setting === 'true' || setting === 'plaintext-only';
59
+ }
60
+ /**
61
+ * Controls and explicitly focusable surfaces whose native key behavior must
62
+ * survive. An element marks itself (or an ancestor) `data-native-keyboard`
63
+ * to keep its native keys without being a control.
64
+ */
65
+ export function isNativeKeyboardTarget(target) {
66
+ if (!(target instanceof Element)) {
67
+ return false;
68
+ }
69
+ return (target.closest('button, input, textarea, select, summary, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"], [data-native-keyboard], [tabindex]:not([tabindex="-1"])') !== null);
70
+ }
71
+ /**
72
+ * Whether a keydown should lose its browser document behaviour: reload,
73
+ * find, print, save, view source, history, select-all on the page, and page
74
+ * scrolling. Meant for a window-level capture listener that cancels the key
75
+ * through `cancelBrowserDocumentKey` without stopping propagation, so a
76
+ * feature can still own the same key.
77
+ *
78
+ * Text editing and native controls retain the keys that have meaningful
79
+ * focused-control behavior, and a modal dialog retains the page-scroll keys
80
+ * aimed into it: its key legend may bind bare keys (Space to pause) and
81
+ * cancels the key itself when a slot runs. A legend slot bound to a chord
82
+ * cancelled here (⌘R) still runs, because `isKeyKept` tells the two cancels
83
+ * apart.
84
+ */
85
+ export function shouldSuppressBrowserDocumentKey(key, target) {
86
+ if (hasUnmodifiedCommand(key) && BROWSER_DOCUMENT_COMMAND_KEYS.has(key.key.toLowerCase())) {
87
+ return true;
88
+ }
89
+ if (hasOptionCommand(key) && key.key.toLowerCase() === 'u') {
90
+ return true;
91
+ }
92
+ if (isTextEditingTarget(target)) {
93
+ return false;
94
+ }
95
+ if (isCommandSelectAll(key)) {
96
+ return true;
97
+ }
98
+ // Chromium's history chords are plain Command, so only those are
99
+ // cancelled; a Shift variant of the brackets is often a native menu
100
+ // accelerator, which a desktop shell hands to the page first and drops if
101
+ // the page cancels it.
102
+ if (hasUnmodifiedCommand(key) && !key.shiftKey && BROWSER_HISTORY_KEYS.has(key.key)) {
103
+ return true;
104
+ }
105
+ if (!key.metaKey && !key.ctrlKey && !key.altKey && key.key === 'Backspace') {
106
+ return true;
107
+ }
108
+ return (!key.metaKey &&
109
+ !key.ctrlKey &&
110
+ !key.altKey &&
111
+ BROWSER_SCROLL_KEYS.has(key.key) &&
112
+ !isNativeKeyboardTarget(target) &&
113
+ !(target instanceof Element && target.closest(MODAL_SELECTOR) !== null));
114
+ }
115
+ /**
116
+ * Whether a modal dialog is open anywhere under `root`. Different parts of
117
+ * an app each own their dialogs, so none reads another's state; the ARIA
118
+ * contract is what they share: any `aria-modal="true"` element holds the
119
+ * window's keys until it closes, the way a native sheet blocks the rest of
120
+ * its window. Over a whole document, ask `watchOverlays`, which answers the
121
+ * same without walking every element.
122
+ */
123
+ export function isModalOpen(root) {
124
+ return root.querySelector(MODAL_SELECTOR) !== null;
125
+ }
126
+ /**
127
+ * Whether any overlay Escape closes is open and in view under `root`, a
128
+ * modal one or one marked `data-overlay` (`OVERLAY_SELECTOR`). An app holds
129
+ * a window-level close such as ⌘W back while it is, so that key closes
130
+ * nothing behind a dialog, a palette, or a menu. An overlay inside a
131
+ * `hidden` ancestor does not count: a view out of sight may keep its menu
132
+ * mounted, and Escape cannot reach it from the view on screen. Over a whole
133
+ * document, ask `watchOverlays`.
134
+ */
135
+ export function isOverlayOpen(root) {
136
+ return [...root.querySelectorAll(OVERLAY_SELECTOR)].some((overlay) => overlay.closest('[hidden]') === null);
137
+ }
@@ -0,0 +1,28 @@
1
+ /** The document's open overlays, answered without walking the document. */
2
+ export interface OverlayWatch {
3
+ /** Whether a modal surface is open anywhere in the document (`isModalOpen`). */
4
+ readonly modalOpen: () => boolean;
5
+ /** Whether an overlay Escape closes is open and in view (`isOverlayOpen`). */
6
+ readonly overlayOpen: () => boolean;
7
+ /**
8
+ * Calls `listener` after each batch of changes that may have changed
9
+ * either answer: an overlay came or went, or a panel holding one was
10
+ * shown or hidden. Returns the unsubscribe.
11
+ */
12
+ readonly subscribe: (listener: () => void) => () => void;
13
+ }
14
+ /**
15
+ * The overlay watch of `document`, made on first use and kept for the
16
+ * document's life. `isModalOpen` and `isOverlayOpen` over the whole
17
+ * document walk every element (two panes of 10,000 rows are about 240,000),
18
+ * and the window asks on every keystroke and after every DOM change. The
19
+ * watch keeps the few elements that match `OVERLAY_SELECTOR` instead,
20
+ * following them with one mutation observer: an added subtree is searched
21
+ * once as it arrives, an element whose `aria-modal` or `data-overlay`
22
+ * changes is checked again, and one no longer in the document is dropped.
23
+ * Each answer first takes the records the observer has not delivered yet,
24
+ * so it is as current as a query of the document, and is then decided by
25
+ * `isModalOpen` and `isOverlayOpen` over the kept elements, the same rules
26
+ * (a `hidden` ancestor included) on far fewer of them.
27
+ */
28
+ export declare function watchOverlays(document: Document): OverlayWatch;
@@ -0,0 +1,119 @@
1
+ import { isModalOpen, isOverlayOpen, OVERLAY_SELECTOR } from './Keyboard.logic.js';
2
+ const watches = new WeakMap();
3
+ /**
4
+ * The overlay watch of `document`, made on first use and kept for the
5
+ * document's life. `isModalOpen` and `isOverlayOpen` over the whole
6
+ * document walk every element (two panes of 10,000 rows are about 240,000),
7
+ * and the window asks on every keystroke and after every DOM change. The
8
+ * watch keeps the few elements that match `OVERLAY_SELECTOR` instead,
9
+ * following them with one mutation observer: an added subtree is searched
10
+ * once as it arrives, an element whose `aria-modal` or `data-overlay`
11
+ * changes is checked again, and one no longer in the document is dropped.
12
+ * Each answer first takes the records the observer has not delivered yet,
13
+ * so it is as current as a query of the document, and is then decided by
14
+ * `isModalOpen` and `isOverlayOpen` over the kept elements, the same rules
15
+ * (a `hidden` ancestor included) on far fewer of them.
16
+ */
17
+ export function watchOverlays(document) {
18
+ const existing = watches.get(document);
19
+ if (existing !== undefined) {
20
+ return existing;
21
+ }
22
+ const kept = new Set(document.querySelectorAll(OVERLAY_SELECTOR));
23
+ const listeners = new Set();
24
+ let notifying = false;
25
+ const keep = (node) => {
26
+ if (!(node instanceof Element)) {
27
+ return;
28
+ }
29
+ if (node.matches(OVERLAY_SELECTOR)) {
30
+ kept.add(node);
31
+ }
32
+ if (node.firstElementChild !== null) {
33
+ for (const overlay of node.querySelectorAll(OVERLAY_SELECTOR)) {
34
+ kept.add(overlay);
35
+ }
36
+ }
37
+ };
38
+ // Records are read against the document as it is now, so a node added and
39
+ // then changed or removed in the same batch is judged by where it ended.
40
+ const apply = (records) => {
41
+ for (const record of records) {
42
+ if (record.type === 'childList') {
43
+ record.addedNodes.forEach(keep);
44
+ }
45
+ else if (record.target instanceof Element && record.attributeName !== 'hidden') {
46
+ if (record.target.matches(OVERLAY_SELECTOR)) {
47
+ kept.add(record.target);
48
+ }
49
+ else {
50
+ kept.delete(record.target);
51
+ }
52
+ }
53
+ }
54
+ for (const element of kept) {
55
+ if (!element.isConnected) {
56
+ kept.delete(element);
57
+ }
58
+ }
59
+ };
60
+ const notify = () => {
61
+ notifying = false;
62
+ for (const listener of [...listeners]) {
63
+ listener();
64
+ }
65
+ };
66
+ const observer = new MutationObserver((records) => {
67
+ apply(records);
68
+ notify();
69
+ });
70
+ observer.observe(document, {
71
+ subtree: true,
72
+ childList: true,
73
+ attributes: true,
74
+ // Showing or hiding a panel toggles `hidden`, and the panel may hold an overlay.
75
+ attributeFilter: ['aria-modal', 'data-overlay', 'hidden']
76
+ });
77
+ // Records an answer took never reach the observer's callback, so their
78
+ // listeners hear of them in a microtask of their own.
79
+ const sync = () => {
80
+ const records = observer.takeRecords();
81
+ if (records.length === 0) {
82
+ return;
83
+ }
84
+ apply(records);
85
+ if (!notifying) {
86
+ notifying = true;
87
+ queueMicrotask(notify);
88
+ }
89
+ };
90
+ const tracked = {
91
+ querySelector: (selector) => {
92
+ for (const element of kept) {
93
+ if (element.matches(selector)) {
94
+ return element;
95
+ }
96
+ }
97
+ return null;
98
+ },
99
+ querySelectorAll: (selector) => [...kept].filter((element) => element.matches(selector))
100
+ };
101
+ const watch = {
102
+ modalOpen: () => {
103
+ sync();
104
+ return isModalOpen(tracked);
105
+ },
106
+ overlayOpen: () => {
107
+ sync();
108
+ return isOverlayOpen(tracked);
109
+ },
110
+ subscribe: (listener) => {
111
+ listeners.add(listener);
112
+ return () => {
113
+ listeners.delete(listener);
114
+ };
115
+ }
116
+ };
117
+ watches.set(document, watch);
118
+ return watch;
119
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Keeps a select-all from selecting the page. A native Select All (an Edit
3
+ * menu item, or ⌘A where no listener cancels it) selects in the window it is
4
+ * chosen in, which with no text field focused would select every selectable
5
+ * run of text on the page.
6
+ *
7
+ * Chromium asks before it selects: a page-wide select-all dispatches a
8
+ * cancelable `selectstart` at the body, and one in a focused field or
9
+ * editable region dispatches it at that element. Cancelling only the
10
+ * body's leaves fields, and a selection a pointer starts on an element,
11
+ * untouched. Install once per page, before it renders; returns the function
12
+ * that removes the hold.
13
+ */
14
+ export declare function holdPageSelectAll(document: Document): () => void;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Keeps a select-all from selecting the page. A native Select All (an Edit
3
+ * menu item, or ⌘A where no listener cancels it) selects in the window it is
4
+ * chosen in, which with no text field focused would select every selectable
5
+ * run of text on the page.
6
+ *
7
+ * Chromium asks before it selects: a page-wide select-all dispatches a
8
+ * cancelable `selectstart` at the body, and one in a focused field or
9
+ * editable region dispatches it at that element. Cancelling only the
10
+ * body's leaves fields, and a selection a pointer starts on an element,
11
+ * untouched. Install once per page, before it renders; returns the function
12
+ * that removes the hold.
13
+ */
14
+ export function holdPageSelectAll(document) {
15
+ const hold = (event) => {
16
+ if (event.target === document.body) {
17
+ event.preventDefault();
18
+ }
19
+ };
20
+ document.addEventListener('selectstart', hold, true);
21
+ return () => document.removeEventListener('selectstart', hold, true);
22
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Keyboard policy and chords: the browser-key guard, the overlay selectors
3
+ * and watch, the page select-all hold, and how chords are drawn and spoken.
4
+ */
5
+ export { cancelBrowserDocumentKey, isKeyKept } from './BrowserKeys.js';
6
+ export { chordGlyphs, chordParts, chordSpoken, LAYER_MODIFIERS, modifierName, type ChordPart, type LayerModifier } from './KeyChord.logic.js';
7
+ export { isModalOpen, isNativeKeyboardTarget, isOverlayOpen, isTextEditingTarget, MODAL_SELECTOR, OVERLAY_SELECTOR, shouldSuppressBrowserDocumentKey, type Chord, type CommandKeyStroke } from './Keyboard.logic.js';
8
+ export { watchOverlays, type OverlayWatch } from './OverlayWatch.js';
9
+ export { holdPageSelectAll } from './PageSelectAll.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Keyboard policy and chords: the browser-key guard, the overlay selectors
3
+ * and watch, the page select-all hold, and how chords are drawn and spoken.
4
+ */
5
+ export { cancelBrowserDocumentKey, isKeyKept } from './BrowserKeys.js';
6
+ export { chordGlyphs, chordParts, chordSpoken, LAYER_MODIFIERS, modifierName } from './KeyChord.logic.js';
7
+ export { isModalOpen, isNativeKeyboardTarget, isOverlayOpen, isTextEditingTarget, MODAL_SELECTOR, OVERLAY_SELECTOR, shouldSuppressBrowserDocumentKey } from './Keyboard.logic.js';
8
+ export { watchOverlays } from './OverlayWatch.js';
9
+ export { holdPageSelectAll } from './PageSelectAll.js';
@@ -0,0 +1,16 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { Chord } from '../keyboard/Keyboard.logic.js';
3
+ import { type LayerModifier } from '../keyboard/KeyChord.logic.js';
4
+ /** Props for {@link KeyChord}: the chord, and what of it is already shown elsewhere. */
5
+ export interface KeyChordProps {
6
+ readonly chord: Chord;
7
+ /** Modifiers already shown elsewhere (a legend's anchor), left out of this drawing. */
8
+ readonly omit?: ReadonlyArray<LayerModifier>;
9
+ }
10
+ /**
11
+ * A chord as a row of key caps in a `<kbd>`. The accessible name is always
12
+ * the full chord in words ("Shift Command N", from `UiokLabels.keys`), even
13
+ * when the drawing omits a modifier a strip shows once. A chord with an
14
+ * empty key draws its modifiers alone.
15
+ */
16
+ export declare function KeyChord({ chord, omit }: KeyChordProps): ReactElement;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ArrowBigUp, ArrowDown, ArrowDownToLine, ArrowLeft, ArrowRight, ArrowRightToLine, ArrowUp, ArrowUpToLine, ChevronUp, ChevronsDown, ChevronsUp, Command, CornerDownLeft, Delete, Option, Slash } from 'lucide-react';
3
+ import { chordParts, chordSpoken } from '../keyboard/KeyChord.logic.js';
4
+ import { useLabels } from '../labels/UiokProvider.js';
5
+ /**
6
+ * Keys drawn as icons. Everything comes from lucide, so every glyph shares one
7
+ * grid and one stroke weight instead of falling to whichever font happens to
8
+ * carry ⌘ or ⇧. Keys without a fitting icon print as short text.
9
+ */
10
+ const KEY_ICONS = {
11
+ ArrowUp,
12
+ ArrowDown,
13
+ ArrowLeft,
14
+ ArrowRight,
15
+ Backspace: Delete,
16
+ Enter: CornerDownLeft,
17
+ Tab: ArrowRightToLine,
18
+ Home: ArrowUpToLine,
19
+ End: ArrowDownToLine,
20
+ PageUp: ChevronsUp,
21
+ PageDown: ChevronsDown,
22
+ '/': Slash
23
+ };
24
+ /** The modifiers as macOS draws them, on the same grid as the keys. */
25
+ const MODIFIER_ICONS = {
26
+ ctrl: ChevronUp,
27
+ alt: Option,
28
+ shift: ArrowBigUp,
29
+ meta: Command
30
+ };
31
+ /**
32
+ * One key of a chord, rendered as an icon or as text in the same box: Escape
33
+ * and the space bar by their key cap words (`KeyLabels`), and any other key
34
+ * as its capital.
35
+ */
36
+ function Key({ part, labels }) {
37
+ const Icon = typeof part === 'object' ? KEY_ICONS[part.key] : MODIFIER_ICONS[part];
38
+ if (Icon) {
39
+ return (_jsx("span", { "aria-hidden": true, className: "key", children: _jsx(Icon, { className: "key-icon" }) }));
40
+ }
41
+ const key = typeof part === 'object' ? part.key : part;
42
+ const text = key === 'Escape' ? labels.escapeCap : key === ' ' ? labels.spaceCap : key.toUpperCase();
43
+ return (_jsx("span", { "aria-hidden": true, className: text.length > 1 ? 'key key-word' : 'key key-letter', children: text }));
44
+ }
45
+ /**
46
+ * A chord as a row of key caps in a `<kbd>`. The accessible name is always
47
+ * the full chord in words ("Shift Command N", from `UiokLabels.keys`), even
48
+ * when the drawing omits a modifier a strip shows once. A chord with an
49
+ * empty key draws its modifiers alone.
50
+ */
51
+ export function KeyChord({ chord, omit = [] }) {
52
+ const { keys } = useLabels();
53
+ const parts = chordParts(chord).filter((part) => typeof part === 'object' ? part.key !== '' : !omit.includes(part));
54
+ return (_jsx("kbd", { "aria-label": chordSpoken(chord, keys), className: "keychord", children: parts.map((part, index) => (_jsx(Key, { labels: keys, part: part }, index))) }));
55
+ }
@@ -0,0 +1,2 @@
1
+ /** `KeyChord`: a chord drawn as key caps, named in words for assistive technology. */
2
+ export { KeyChord, type KeyChordProps } from './KeyChord.js';
@@ -0,0 +1,2 @@
1
+ /** `KeyChord`: a chord drawn as key caps, named in words for assistive technology. */
2
+ export { KeyChord } from './KeyChord.js';
@@ -0,0 +1,41 @@
1
+ /* ---- Key chord (KeyChord) ----
2
+
3
+ A chord as a row of keys, drawn in key legends, menus, settings, and a
4
+ dialog's legend. One grid for every key: an 11px icon or a 10px letter in
5
+ the same 12px box, so a modifier sits at the cap height of the mono text
6
+ beside it. The chord itself has no frame; a surface that draws it as a key
7
+ cap adds the border and ground around .keychord. */
8
+ .keychord {
9
+ display: inline-flex;
10
+ align-items: center;
11
+ gap: 2px;
12
+ font: inherit;
13
+ }
14
+
15
+ .key {
16
+ display: inline-flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ width: 12px;
20
+ height: 12px;
21
+ }
22
+
23
+ .key-icon {
24
+ width: 11px;
25
+ height: 11px;
26
+ display: block;
27
+ }
28
+
29
+ /* Mono capitals sit above the optical centre of their em box; nudge them onto the icon centre. */
30
+ .key-letter {
31
+ font: 600 10px/12px var(--font-mono);
32
+ padding-top: 1px;
33
+ box-sizing: border-box;
34
+ }
35
+
36
+ .key-word {
37
+ width: auto;
38
+ padding: 0 1px;
39
+ font: 600 9px/12px var(--font-mono);
40
+ letter-spacing: 0.02em;
41
+ }
@@ -0,0 +1,41 @@
1
+ import { type ChartLabels } from './charts.js';
2
+ import { type DateTimeLabels } from './dateTime.js';
3
+ import { type DialogLabels } from './dialog.js';
4
+ import { type KeyLabels } from './keys.js';
5
+ import { type LegendLabels } from './legend.js';
6
+ import { type ListingLabels } from './listing.js';
7
+ import { type PagerLabels } from './pager.js';
8
+ import { type PaletteLabels } from './palette.js';
9
+ import { type SelectAllLabels } from './selectAll.js';
10
+ import { type TerminalLabels } from './terminal.js';
11
+ /**
12
+ * Every chrome string UIOK's components share across instances, grouped by
13
+ * area: key names, and, as areas arrive, verbs such as Cancel and More.
14
+ * Copy that differs per instance (a dialog's title, a button's words) is a
15
+ * prop instead. An app supplies its translations through `UiokProvider`;
16
+ * whatever it leaves out stays English.
17
+ */
18
+ export interface UiokLabels {
19
+ /** Key and modifier names, glyphs, and key cap words (`KeyChord`, `chordSpoken`). */
20
+ readonly keys: KeyLabels;
21
+ /** Chart read-outs, the scatter chart's count and zoom words, and picture export messages (`@bigpixelrocket/uiok/charts`). */
22
+ readonly charts: ChartLabels;
23
+ /** A date and time picker's month steps, time fields, buttons, and name locale (`DateTimePicker`). */
24
+ readonly dateTime: DateTimeLabels;
25
+ /** Dialog leave verbs and a confirmation's list name (`ConfirmDialog`, `filterLeaveLabel`). */
26
+ readonly dialog: DialogLabels;
27
+ /** A key legend strip's own name, its verb group, paired cap names, and overflow count (`KeyLegendStrip`, `moreLabel`). */
28
+ readonly legend: LegendLabels;
29
+ /** A listing's column strip: the sorting label's accessible name (`Listing`, `Strip`). */
30
+ readonly listing: ListingLabels;
31
+ /** A long list's pager: its steps and its page menu (`Pager`). */
32
+ readonly pager: PagerLabels;
33
+ /** A palette's query row: the level chip and a refused keystroke (`PaletteQuery`). */
34
+ readonly palette: PaletteLabels;
35
+ /** A select-all bar's checkbox and lead-in (`SelectAllBar`). */
36
+ readonly selectAll: SelectAllLabels;
37
+ /** A terminal's menu, its failure line, and its input's fallback name (`@bigpixelrocket/uiok/terminal`). */
38
+ readonly terminal: TerminalLabels;
39
+ }
40
+ /** The English labels every component falls back to without a `UiokProvider`. */
41
+ export declare const DEFAULT_LABELS: UiokLabels;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * The composition point for every label group. Each area that shows shared
3
+ * chrome strings defines its group in its own module beside this one
4
+ * (`keys.ts`: an interface and its English defaults), then adds one field to
5
+ * `UiokLabels` and one to `DEFAULT_LABELS` here. Groups are flat records of
6
+ * strings, records of strings, and functions for copy with a count or a
7
+ * value in it (`affectedItems(count)`), so a partial override merges cleanly.
8
+ */
9
+ import { DEFAULT_CHART_LABELS } from './charts.js';
10
+ import { DEFAULT_DATE_TIME_LABELS } from './dateTime.js';
11
+ import { DEFAULT_DIALOG_LABELS } from './dialog.js';
12
+ import { DEFAULT_KEY_LABELS } from './keys.js';
13
+ import { DEFAULT_LEGEND_LABELS } from './legend.js';
14
+ import { DEFAULT_LISTING_LABELS } from './listing.js';
15
+ import { DEFAULT_PAGER_LABELS } from './pager.js';
16
+ import { DEFAULT_PALETTE_LABELS } from './palette.js';
17
+ import { DEFAULT_SELECT_ALL_LABELS } from './selectAll.js';
18
+ import { DEFAULT_TERMINAL_LABELS } from './terminal.js';
19
+ /** The English labels every component falls back to without a `UiokProvider`. */
20
+ export const DEFAULT_LABELS = {
21
+ keys: DEFAULT_KEY_LABELS,
22
+ charts: DEFAULT_CHART_LABELS,
23
+ dateTime: DEFAULT_DATE_TIME_LABELS,
24
+ dialog: DEFAULT_DIALOG_LABELS,
25
+ legend: DEFAULT_LEGEND_LABELS,
26
+ listing: DEFAULT_LISTING_LABELS,
27
+ pager: DEFAULT_PAGER_LABELS,
28
+ palette: DEFAULT_PALETTE_LABELS,
29
+ selectAll: DEFAULT_SELECT_ALL_LABELS,
30
+ terminal: DEFAULT_TERMINAL_LABELS
31
+ };
@@ -0,0 +1,44 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ import { type UiokLabels } from './UiokLabels.js';
3
+ /**
4
+ * A partial copy of a label group, or of `UiokLabels` whole: every record
5
+ * may leave out any field, at any depth, and a function stays a function
6
+ * (it is replaced, never merged).
7
+ */
8
+ export type LabelsOverride<T> = {
9
+ readonly [K in keyof T]?: T[K] extends (...args: never[]) => unknown ? T[K] : T[K] extends object ? LabelsOverride<T[K]> : T[K];
10
+ };
11
+ /** The labels an app passes to `UiokProvider`: any part of `UiokLabels`. */
12
+ export type UiokLabelsOverride = LabelsOverride<UiokLabels>;
13
+ /**
14
+ * `base` with every field `override` gives laid over it, record by record at
15
+ * any depth, so an override of one key name keeps every other. A field the
16
+ * override leaves out or sets to `undefined` keeps the base's value. For
17
+ * code outside React (a keymap printing chords) that needs the same labels
18
+ * `UiokProvider` would give.
19
+ */
20
+ export declare function mergeLabels(base: UiokLabels, override: UiokLabelsOverride | undefined): UiokLabels;
21
+ /** Props for {@link UiokProvider}. */
22
+ export interface UiokProviderProps {
23
+ /**
24
+ * The labels to use below, in part or whole; what is left out comes from
25
+ * the provider above, or English. Keep the object's identity across
26
+ * renders (build it once per language) so the components below need not
27
+ * render again.
28
+ */
29
+ readonly labels?: UiokLabelsOverride;
30
+ readonly children?: ReactNode;
31
+ }
32
+ /**
33
+ * Supplies the shared chrome strings (`UiokLabels`) to every UIOK component
34
+ * below it. Mount it once near the app's root with the app's translations;
35
+ * without one, components speak English. A provider inside another merges
36
+ * its labels over the outer one's, so a subtree can change one group alone.
37
+ */
38
+ export declare function UiokProvider({ labels, children }: UiokProviderProps): ReactElement;
39
+ /**
40
+ * The labels in effect where a component renders: the nearest
41
+ * `UiokProvider`'s, merged over English defaults. A component that shows
42
+ * shared chrome reads its group from here (`useLabels().keys`).
43
+ */
44
+ export declare function useLabels(): UiokLabels;
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo } from 'react';
3
+ import { DEFAULT_LABELS } from './UiokLabels.js';
4
+ /** Whether `value` is a record to merge field by field: an object of no class, not an array. */
5
+ const isRecord = (value) => {
6
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) {
7
+ return false;
8
+ }
9
+ const prototype = Object.getPrototypeOf(value);
10
+ return prototype === Object.prototype || prototype === null;
11
+ };
12
+ const mergeRecords = (base, override) => {
13
+ const merged = { ...base };
14
+ for (const [field, value] of Object.entries(override)) {
15
+ if (value === undefined) {
16
+ continue;
17
+ }
18
+ const earlier = merged[field];
19
+ merged[field] = isRecord(earlier) && isRecord(value) ? mergeRecords(earlier, value) : value;
20
+ }
21
+ return merged;
22
+ };
23
+ /**
24
+ * `base` with every field `override` gives laid over it, record by record at
25
+ * any depth, so an override of one key name keeps every other. A field the
26
+ * override leaves out or sets to `undefined` keeps the base's value. For
27
+ * code outside React (a keymap printing chords) that needs the same labels
28
+ * `UiokProvider` would give.
29
+ */
30
+ export function mergeLabels(base, override) {
31
+ return override === undefined
32
+ ? base
33
+ : mergeRecords(base, override);
34
+ }
35
+ const LabelsContext = createContext(DEFAULT_LABELS);
36
+ /**
37
+ * Supplies the shared chrome strings (`UiokLabels`) to every UIOK component
38
+ * below it. Mount it once near the app's root with the app's translations;
39
+ * without one, components speak English. A provider inside another merges
40
+ * its labels over the outer one's, so a subtree can change one group alone.
41
+ */
42
+ export function UiokProvider({ labels, children }) {
43
+ const outer = useContext(LabelsContext);
44
+ const merged = useMemo(() => mergeLabels(outer, labels), [outer, labels]);
45
+ return _jsx(LabelsContext, { value: merged, children: children });
46
+ }
47
+ /**
48
+ * The labels in effect where a component renders: the nearest
49
+ * `UiokProvider`'s, merged over English defaults. A component that shows
50
+ * shared chrome reads its group from here (`useLabels().keys`).
51
+ */
52
+ export function useLabels() {
53
+ return useContext(LabelsContext);
54
+ }