@bigpixelrocket/uiok 0.2.3 → 0.4.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 (215) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/charts/Sparkline.d.ts +20 -0
  3. package/dist/charts/Sparkline.js +12 -0
  4. package/dist/charts/Sparkline.logic.d.ts +9 -0
  5. package/dist/charts/Sparkline.logic.js +27 -0
  6. package/dist/charts/charts.css +17 -0
  7. package/dist/charts/index.d.ts +2 -0
  8. package/dist/charts/index.js +2 -0
  9. package/dist/dialog/ConfirmDialog.d.ts +17 -1
  10. package/dist/dialog/ConfirmDialog.js +4 -3
  11. package/dist/dialog/ModalDialog.d.ts +8 -0
  12. package/dist/dialog/ModalDialog.js +4 -2
  13. package/dist/dialog/ProgressDialog.d.ts +40 -0
  14. package/dist/dialog/ProgressDialog.js +40 -0
  15. package/dist/dialog/TypedNameDialog.d.ts +44 -0
  16. package/dist/dialog/TypedNameDialog.js +17 -0
  17. package/dist/dialog/index.d.ts +5 -2
  18. package/dist/dialog/index.js +4 -1
  19. package/dist/field/Check.d.ts +9 -2
  20. package/dist/field/Check.js +5 -4
  21. package/dist/field/Controls.d.ts +198 -0
  22. package/dist/field/Controls.js +94 -0
  23. package/dist/field/FieldLayout.d.ts +126 -0
  24. package/dist/field/FieldLayout.js +89 -0
  25. package/dist/field/Switch.d.ts +26 -0
  26. package/dist/field/Switch.js +20 -0
  27. package/dist/field/index.d.ts +10 -6
  28. package/dist/field/index.js +10 -6
  29. package/dist/frame/AppRoot.d.ts +44 -0
  30. package/dist/frame/AppRoot.js +26 -0
  31. package/dist/frame/Dock.d.ts +88 -0
  32. package/dist/frame/Dock.js +129 -0
  33. package/dist/frame/FilterChips.d.ts +28 -0
  34. package/dist/frame/FilterChips.js +14 -0
  35. package/dist/frame/PageParts.d.ts +69 -0
  36. package/dist/frame/PageParts.js +60 -0
  37. package/dist/frame/PaneSplit.d.ts +74 -0
  38. package/dist/frame/PaneSplit.js +197 -0
  39. package/dist/frame/SidebarResizer.d.ts +35 -0
  40. package/dist/frame/SidebarResizer.js +43 -0
  41. package/dist/frame/StatusNotice.d.ts +20 -0
  42. package/dist/frame/StatusNotice.js +13 -0
  43. package/dist/frame/Tree.d.ts +147 -0
  44. package/dist/frame/Tree.js +164 -0
  45. package/dist/frame/TreeToggle.d.ts +18 -0
  46. package/dist/frame/TreeToggle.js +17 -0
  47. package/dist/frame/WindowFrame.d.ts +57 -0
  48. package/dist/frame/WindowFrame.js +19 -0
  49. package/dist/frame/frame.css +801 -0
  50. package/dist/frame/index.d.ts +22 -0
  51. package/dist/frame/index.js +22 -0
  52. package/dist/frame/sharedRef.d.ts +8 -0
  53. package/dist/frame/sharedRef.js +26 -0
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.js +3 -0
  56. package/dist/labels/UiokLabels.d.ts +6 -0
  57. package/dist/labels/UiokLabels.js +5 -1
  58. package/dist/labels/dialog.d.ts +12 -0
  59. package/dist/labels/dialog.js +7 -1
  60. package/dist/labels/index.d.ts +2 -0
  61. package/dist/labels/index.js +2 -0
  62. package/dist/labels/settings.d.ts +46 -0
  63. package/dist/labels/settings.js +29 -0
  64. package/dist/labels/viewer.d.ts +193 -0
  65. package/dist/labels/viewer.js +124 -0
  66. package/dist/listing/EmptyState.d.ts +40 -0
  67. package/dist/listing/EmptyState.js +14 -0
  68. package/dist/listing/PaneMessage.d.ts +28 -0
  69. package/dist/listing/PaneMessage.js +12 -0
  70. package/dist/listing/index.d.ts +5 -1
  71. package/dist/listing/index.js +5 -1
  72. package/dist/listing/listing.css +66 -2
  73. package/dist/log/LogWell.d.ts +34 -0
  74. package/dist/log/LogWell.js +39 -0
  75. package/dist/log/LogWell.logic.d.ts +16 -0
  76. package/dist/log/LogWell.logic.js +26 -0
  77. package/dist/log/index.d.ts +8 -0
  78. package/dist/log/index.js +8 -0
  79. package/dist/log/log.css +57 -0
  80. package/dist/pane/Pane.d.ts +49 -0
  81. package/dist/pane/Pane.js +17 -0
  82. package/dist/pane/PaneKeys.d.ts +10 -3
  83. package/dist/pane/PaneKeys.js +26 -7
  84. package/dist/pane/index.d.ts +4 -2
  85. package/dist/pane/index.js +4 -2
  86. package/dist/pane/usePaneKeys.js +9 -11
  87. package/dist/shell/AboutWindow.d.ts +21 -0
  88. package/dist/shell/AboutWindow.js +10 -0
  89. package/dist/shell/LanguageChoice.d.ts +27 -0
  90. package/dist/shell/LanguageChoice.js +17 -0
  91. package/dist/shell/LoadFailure.d.ts +22 -0
  92. package/dist/shell/LoadFailure.js +15 -0
  93. package/dist/shell/Lockup.d.ts +52 -0
  94. package/dist/shell/Lockup.js +30 -0
  95. package/dist/shell/SettingsDialog.d.ts +97 -0
  96. package/dist/shell/SettingsDialog.js +219 -0
  97. package/dist/shell/SettingsDialog.logic.d.ts +33 -0
  98. package/dist/shell/SettingsDialog.logic.js +42 -0
  99. package/dist/shell/SettingsFiles.d.ts +55 -0
  100. package/dist/shell/SettingsFiles.js +30 -0
  101. package/dist/shell/SettingsPageKeys.d.ts +42 -0
  102. package/dist/shell/SettingsPageKeys.js +70 -0
  103. package/dist/shell/SettingsSubsection.d.ts +34 -0
  104. package/dist/shell/SettingsSubsection.js +30 -0
  105. package/dist/shell/SignIn.d.ts +61 -0
  106. package/dist/shell/SignIn.js +36 -0
  107. package/dist/shell/ThemePicker.d.ts +74 -0
  108. package/dist/shell/ThemePicker.js +96 -0
  109. package/dist/shell/ThemePicker.logic.d.ts +13 -0
  110. package/dist/shell/ThemePicker.logic.js +26 -0
  111. package/dist/shell/TitleBar.d.ts +44 -0
  112. package/dist/shell/TitleBar.js +23 -0
  113. package/dist/shell/UpdatePill.d.ts +26 -0
  114. package/dist/shell/UpdatePill.js +17 -0
  115. package/dist/shell/Updates.d.ts +99 -0
  116. package/dist/shell/Updates.js +72 -0
  117. package/dist/shell/index.d.ts +27 -0
  118. package/dist/shell/index.js +27 -0
  119. package/dist/shell/shell.css +243 -4
  120. package/dist/styles.css +5 -0
  121. package/dist/surface/Card.d.ts +18 -0
  122. package/dist/surface/Card.js +10 -0
  123. package/dist/surface/Notice.d.ts +45 -0
  124. package/dist/surface/Notice.js +27 -0
  125. package/dist/surface/index.d.ts +5 -3
  126. package/dist/surface/index.js +5 -3
  127. package/dist/themes/catalog.js +4 -0
  128. package/dist/themes/themes.generated.css +245 -0
  129. package/dist/themes/tokens.d.ts +17 -5
  130. package/dist/themes/tokens.js +67 -1
  131. package/dist/tokens.css +11 -0
  132. package/dist/viewer/AudioView.d.ts +13 -0
  133. package/dist/viewer/AudioView.js +25 -0
  134. package/dist/viewer/HexJump.logic.d.ts +16 -0
  135. package/dist/viewer/HexJump.logic.js +27 -0
  136. package/dist/viewer/HexRows.logic.d.ts +55 -0
  137. package/dist/viewer/HexRows.logic.js +84 -0
  138. package/dist/viewer/HexSelection.logic.d.ts +57 -0
  139. package/dist/viewer/HexSelection.logic.js +68 -0
  140. package/dist/viewer/HexView.d.ts +10 -0
  141. package/dist/viewer/HexView.js +291 -0
  142. package/dist/viewer/HexViewport.logic.d.ts +61 -0
  143. package/dist/viewer/HexViewport.logic.js +79 -0
  144. package/dist/viewer/ImageView.d.ts +19 -0
  145. package/dist/viewer/ImageView.js +230 -0
  146. package/dist/viewer/ImageZoom.logic.d.ts +65 -0
  147. package/dist/viewer/ImageZoom.logic.js +119 -0
  148. package/dist/viewer/LatestRead.logic.d.ts +27 -0
  149. package/dist/viewer/LatestRead.logic.js +55 -0
  150. package/dist/viewer/MediaControls.d.ts +25 -0
  151. package/dist/viewer/MediaControls.js +183 -0
  152. package/dist/viewer/MediaPlayer.logic.d.ts +53 -0
  153. package/dist/viewer/MediaPlayer.logic.js +68 -0
  154. package/dist/viewer/PdfView.d.ts +23 -0
  155. package/dist/viewer/PdfView.js +25 -0
  156. package/dist/viewer/QuietFocus.d.ts +19 -0
  157. package/dist/viewer/QuietFocus.js +27 -0
  158. package/dist/viewer/ScaledScroll.logic.d.ts +30 -0
  159. package/dist/viewer/ScaledScroll.logic.js +28 -0
  160. package/dist/viewer/ScaledScrollbar.d.ts +19 -0
  161. package/dist/viewer/ScaledScrollbar.js +71 -0
  162. package/dist/viewer/SyntaxHighlighter.d.ts +29 -0
  163. package/dist/viewer/SyntaxHighlighter.js +144 -0
  164. package/dist/viewer/SyntaxLanguage.logic.d.ts +110 -0
  165. package/dist/viewer/SyntaxLanguage.logic.js +283 -0
  166. package/dist/viewer/SyntaxService.d.ts +75 -0
  167. package/dist/viewer/SyntaxService.js +49 -0
  168. package/dist/viewer/SyntaxSession.logic.d.ts +78 -0
  169. package/dist/viewer/SyntaxSession.logic.js +221 -0
  170. package/dist/viewer/SyntaxWorker.d.ts +6 -0
  171. package/dist/viewer/SyntaxWorker.js +8 -0
  172. package/dist/viewer/TextEncoding.logic.d.ts +35 -0
  173. package/dist/viewer/TextEncoding.logic.js +58 -0
  174. package/dist/viewer/TextRows.logic.d.ts +86 -0
  175. package/dist/viewer/TextRows.logic.js +241 -0
  176. package/dist/viewer/TextSelection.logic.d.ts +97 -0
  177. package/dist/viewer/TextSelection.logic.js +139 -0
  178. package/dist/viewer/TextView.d.ts +13 -0
  179. package/dist/viewer/TextView.js +448 -0
  180. package/dist/viewer/TextViewport.logic.d.ts +70 -0
  181. package/dist/viewer/TextViewport.logic.js +116 -0
  182. package/dist/viewer/VideoView.d.ts +18 -0
  183. package/dist/viewer/VideoView.js +53 -0
  184. package/dist/viewer/ViewerClipboard.d.ts +30 -0
  185. package/dist/viewer/ViewerClipboard.js +70 -0
  186. package/dist/viewer/ViewerFrame.logic.d.ts +61 -0
  187. package/dist/viewer/ViewerFrame.logic.js +130 -0
  188. package/dist/viewer/ViewerKeys.d.ts +16 -0
  189. package/dist/viewer/ViewerKeys.js +14 -0
  190. package/dist/viewer/ViewerScope.d.ts +12 -0
  191. package/dist/viewer/ViewerScope.js +22 -0
  192. package/dist/viewer/ViewerViews.d.ts +28 -0
  193. package/dist/viewer/ViewerViews.js +22 -0
  194. package/dist/viewer/ViewerWindow.d.ts +53 -0
  195. package/dist/viewer/ViewerWindow.js +219 -0
  196. package/dist/viewer/index.d.ts +12 -0
  197. package/dist/viewer/index.js +12 -0
  198. package/dist/viewer/types.d.ts +151 -0
  199. package/dist/viewer/types.js +26 -0
  200. package/dist/viewer/useElementHeight.d.ts +6 -0
  201. package/dist/viewer/useElementHeight.js +22 -0
  202. package/dist/viewer/useElementSize.d.ts +7 -0
  203. package/dist/viewer/useElementSize.js +24 -0
  204. package/dist/viewer/useEscapeToClear.d.ts +8 -0
  205. package/dist/viewer/useEscapeToClear.js +26 -0
  206. package/dist/viewer/useHexDocument.d.ts +41 -0
  207. package/dist/viewer/useHexDocument.js +144 -0
  208. package/dist/viewer/useMediaElement.d.ts +10 -0
  209. package/dist/viewer/useMediaElement.js +24 -0
  210. package/dist/viewer/useSyntaxHighlight.d.ts +24 -0
  211. package/dist/viewer/useSyntaxHighlight.js +133 -0
  212. package/dist/viewer/useTextDocument.d.ts +66 -0
  213. package/dist/viewer/useTextDocument.js +245 -0
  214. package/dist/viewer/viewer.css +645 -0
  215. package/package.json +7 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,51 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.0] - 2026-11-23
10
+
11
+ ### Added
12
+
13
+ - The file viewer (`@bigpixelrocket/uiok/viewer`, a new area beside the root, like the terminal): `ViewerWindow` shows one file as text with syntax highlighting and line numbers, hex, image, audio, video, or PDF, reading a bounded range at a time through a `ViewerReader` the app supplies (`inspect`, `readRange`, `reload`, `lineNumber`), with a mode switch, change notices and Reload, fallbacks to hex or source, copy, Go to Offset, zoom, and a media player. `isViewerCloseKey`, `openSyntaxWorker`, `VIEWER_MAX_READ_BYTES`, and the reader's data types. Highlighting runs Shiki on its JavaScript regex engine in a worker the viewer starts itself; each grammar loads only when a file needs it.
14
+ - The `viewer` label group (`ViewerLabels`, `ViewerModeLabels`, `ViewerContentLabels`, `DEFAULT_VIEWER_LABELS`), its number, size, and date formats included.
15
+ - Form components (`@bigpixelrocket/uiok/field`), so an app draws a form with no class name or raw element: `TextField`, `TextArea`, `Select` (`SelectOption`, `SelectOptionGroup`), `FieldBox`, `FieldEditor`, `Radio`, `Range`, `Meter`, `RestoreDefault`; the layout `FieldGrid`, `FieldRow` (wires its control's id, note, problem, invalid state, and help on its own; `useFieldWiring` for a control of the app's), `FieldOption`, `FieldGroup`, `FieldNote`, `FieldProblem`. `Check` takes a `label` and a `tone`.
16
+ - `Notice` and `Card` (`@bigpixelrocket/uiok/surface`), and `PaneMessage` (`@bigpixelrocket/uiok/listing`): the `.notice`, `.card`, and `.pane-message` looks as components.
17
+ - `TreeTool` takes a `rowKey`, which joins it to the pane's row cursor as a `TreeRow` is, as a `treeitem`.
18
+ - `ProgressDialog`, `ConfirmDialog`, and `TypedNameDialog` take a `container`; `TypedNameDialog` takes `groups`.
19
+ - Theme token `--letterbox` (a video's letterbox, black in every theme).
20
+
21
+ ### Changed
22
+
23
+ - Breaking: uiok now defines `--letterbox`, so `themeStylesheet` refuses an app token of that name. An app that wrote it as its own token drops it; the value is the same.
24
+ - `SidebarResizer` and `Dock`'s edge no longer set `aria-valuenow`, `aria-valuemin`, or `aria-valuemax`: they take no focus, so a screen reader could not change the value it offered.
25
+
26
+ ### Fixed
27
+
28
+ - `TreeList` mounted inside a shadow root keeps its `aria-activedescendant`: it finds the cursor row in its own root, not the document. A tree mounted in an element not yet attached no longer throws.
29
+
30
+ ## [0.3.0] - 2026-11-23
31
+
32
+ ### Added
33
+
34
+ - The shell's components (`@bigpixelrocket/uiok/shell`, now an area with a module): `TitleBar`, `Lockup`, `BrandMark` (the family's plate, the app's glyph, and the check badge), `ChannelMarker`, `UpdatePill`, `AboutWindow`, `SettingsDialog` with `SettingsSubsection`, `SettingsSaveFailure`, page keys (`useSettingsPageKeys`, `settingsLegend`, `SettingsPageKeysContext`), and the scroll rules `spiedSubsection` and `subsectionScrollTop`, and the shared pages `AppearanceSettings` over `ThemeChoices` and `ThemePreview`, `LanguageChoice`, `UpdatesPage` with `UpdateChecks`, `UpdateCard`, and `UpdateNotes`, and `SettingsFiles`; the sign-in prompts `SignInDialog` and `HostKeyDialog`; `useSystemDark`, `appearanceInUse`, `steppedIndex`, `themesOf`.
35
+ - The window frame (`@bigpixelrocket/uiok/frame`, a new area), every part a component so an app draws its window with no class or element of its own: `AppRoot`, `SpacePanel`, `WindowFrame` (the title band, sidebar, main pane, tray, dock, and key legend in one grid, the space's listing root, with a `group` for a host's handlers and a band `trailing` part; a part given `false` draws no slot), `SidebarResizer` and `draggedWidth`; the sidebar tree's `TreePane`, `TreeList`, `TreeRow` (node, band, or group, following the pane's cursor), `TreeToggle`, `TreeTool`, `TreeFilterInput`, and `SidebarEmpty`; `FilterChips`, `PaneWarning`, `StatusNotice`; `Dock` (at the height its host keeps, its top edge dragging it, giving way to the main pane in a short window; `dockHeight`), `DockLog`, `DockLogEntry`, `DockInput`; `usePaneSplit`, `PaneSplitter`, `SplitDetail`, `cutRowDepth`, and `heldSplitHeight`; a page's `PageSlot`, `PanePage`, `Toolbar`, `ToolbarGrow`, `ToolbarGap`, `PageFilter`, `PageNote`, `EmptyAction`, `SectionHead`, `FootBar`, and `ShowSidebarButton`.
36
+ - `PaneBox` (with a `danger` tone) and `PaneList` (`@bigpixelrocket/uiok/pane`): a pane and its scrolling body, with `RegionHandlers`, the handlers a host hangs on a region.
37
+ - `EmptyState` (`@bigpixelrocket/uiok/listing`): a pane with nothing in it yet or one that could not load, with its glyph or mark, title, sentence, actions, note, detail, and numbered steps.
38
+ - `Switch` (`@bigpixelrocket/uiok/field`): the `.switch` look as a component, out of the Tab order in a listing row, a press never opening the row.
39
+ - `LoadFailure` (`@bigpixelrocket/uiok/shell`): the block a window shows in place of content that failed to load. A `SettingsPage` names its sidebar chip as `chip` (a string), drawn by the dialog.
40
+ - `ModalDialog` and `ConfirmDialog` take a `size` (`DialogSize`: `md`, `lg`, `xl`); `ConfirmDialog` takes an `alternative`, a second way on between leaving and confirming (Close Window and Keep Running).
41
+ - `LogWell` (`@bigpixelrocket/uiok/log`, a new area): a log in a well with each source's prefix in its own colour, a line's tone, and following the newest line; `logSourceIndexes`, `logSourceColour`, `logSourceWidth`.
42
+ - `Sparkline` and `sparklinePoints` (`@bigpixelrocket/uiok/charts`).
43
+ - `ProgressDialog` and `TypedNameDialog` (`@bigpixelrocket/uiok/dialog`).
44
+ - Theme tokens: the release channels (`--channel-latest`, `--channel-local`, their `-text`, `--channel-name`, `--channel-detail`, and `[data-channel]` blocks that set `--channel` and `--channel-text`), the brand mark (`--brand-white`, `--brand-plate`, `--brand-plate-dark`, `--brand-badge-dark`), and a log's sources (`--log-source-1` to `--log-source-6`).
45
+ - Scale tokens: `--font-weight-light`, `--font-weight-heavy`, `--shell-header-height`, `--traffic-light-inset`, `--sidebar-width`.
46
+ - The `settings` label group (`SettingsLabels`, `AppearanceLabels`, `AppearanceMode`, `DEFAULT_SETTINGS_LABELS`) and the `dialog` labels `ok`, `close`, `stop`, `tryAgain`, `runInBackground`, `typeName`.
47
+ - `shell.css`: the title bar (`shell-topbar`, `shell-brand`, `shell-lockup`, `shell-channel*`, `shell-trailing`), the lockup (sized by `Lockup`'s `size`) and brand mark (its glyph as `BrandMarkShape` data), the About window's drag regions and icon, `settings-restore`, `settings-count`, `settings-count-or-word`.
48
+
49
+ ### Changed
50
+
51
+ - `usePaneKeys` never reads a home, row, or verb inside a `hidden` element (a page held out of sight), and with no sidebar shown Tab walks the page alone instead of naming a sidebar that is not there.
52
+ - Breaking: uiok now defines `--channel`, `--channel-text`, `--channel-name`, `--channel-detail`, `--channel-latest`, `--channel-latest-text`, `--channel-local`, `--channel-local-text`, `--brand-white`, and `--brand-plate`, so `themeStylesheet` refuses an app token of those names. An app that wrote them as its own tokens drops them; the values are the same in every theme.
53
+
9
54
  ## [0.2.3] - 2026-11-22
10
55
 
11
56
  ### Added
@@ -200,7 +245,9 @@ The first published version. The package is published to npm as `@bigpixelrocket
200
245
  - `lucide-react` 1.31 or later within 1.x is a peer dependency.
201
246
  - Terminal (`@bigpixelrocket/uiok/terminal`, `docs/components/terminal.md`): `Terminal`, Ghostty's VT engine as WebAssembly drawn on a canvas, read-only without `onInput`, with a Copy and Paste menu whose chords come from `menuChords`, a visual bell, line-editing actions bound by `actionForKey`, and `TerminalScrollbackContext`. The package root does not export it, so an app without a terminal never loads its assets. Its words are the new `terminal` label group; the package now ships a `NOTICE` with the engine's, adapter's, and font's licences.
202
247
 
203
- [Unreleased]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.3...HEAD
248
+ [Unreleased]: https://github.com/Bigpixelrocket/uiok/compare/v0.4.0...HEAD
249
+ [0.4.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.3.0...v0.4.0
250
+ [0.3.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.3...v0.3.0
204
251
  [0.2.3]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.2...v0.2.3
205
252
  [0.2.2]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.1...v0.2.2
206
253
  [0.2.1]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.0...v0.2.1
@@ -0,0 +1,20 @@
1
+ import type { ReactElement } from 'react';
2
+ /** Props for {@link Sparkline}. */
3
+ export interface SparklineProps {
4
+ /** The values, oldest first. */
5
+ readonly values: readonly number[];
6
+ /** What the line shows and its latest value in words ("CPU, 12% now"), its accessible name. */
7
+ readonly label: string;
8
+ /** Which chart series colour it wears (`seriesColour`); the first unless given. */
9
+ readonly series?: number;
10
+ /** Its size in pixels; 64 by 16 unless given, the height of a row's text. */
11
+ readonly width?: number;
12
+ readonly height?: number;
13
+ }
14
+ /**
15
+ * A word-sized line of recent values beside a figure (a process's CPU over
16
+ * the last minutes): no axes, no grid, the line alone in a series colour,
17
+ * scaled to its own lowest and highest. It is an image named by `label`,
18
+ * which carries what a reader needs; the line only shows the trend.
19
+ */
20
+ export declare function Sparkline({ values, label, series, width, height }: SparklineProps): ReactElement;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { sparklinePoints } from './Sparkline.logic.js';
3
+ import { seriesColour } from './seriesColour.js';
4
+ /**
5
+ * A word-sized line of recent values beside a figure (a process's CPU over
6
+ * the last minutes): no axes, no grid, the line alone in a series colour,
7
+ * scaled to its own lowest and highest. It is an image named by `label`,
8
+ * which carries what a reader needs; the line only shows the trend.
9
+ */
10
+ export function Sparkline({ values, label, series = 0, width = 64, height = 16 }) {
11
+ return (_jsx("svg", { "aria-label": label, className: "sparkline", height: height, role: "img", viewBox: `0 0 ${width} ${height}`, width: width, children: _jsx("polyline", { className: "sparkline-line", points: sparklinePoints(values, width, height), style: { stroke: seriesColour(series) } }) }));
12
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The points of a sparkline of `values` in a box `width` by `height`, as an
3
+ * SVG `points` list: evenly spaced from the left edge to the right, the
4
+ * smallest value at the foot and the largest at the head, each kept
5
+ * `inset` from the top and bottom edges so the stroke is never cut. A flat
6
+ * series runs through the middle; one value is a flat line across the box.
7
+ * Values that are not finite are left out. Empty for no value.
8
+ */
9
+ export declare function sparklinePoints(values: readonly number[], width: number, height: number, inset?: number): string;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The points of a sparkline of `values` in a box `width` by `height`, as an
3
+ * SVG `points` list: evenly spaced from the left edge to the right, the
4
+ * smallest value at the foot and the largest at the head, each kept
5
+ * `inset` from the top and bottom edges so the stroke is never cut. A flat
6
+ * series runs through the middle; one value is a flat line across the box.
7
+ * Values that are not finite are left out. Empty for no value.
8
+ */
9
+ export function sparklinePoints(values, width, height, inset = 1) {
10
+ const finite = values.filter((value) => Number.isFinite(value));
11
+ if (finite.length === 0) {
12
+ return '';
13
+ }
14
+ const series = finite.length === 1 ? [finite[0], finite[0]] : finite;
15
+ const low = Math.min(...series);
16
+ const high = Math.max(...series);
17
+ const span = high - low;
18
+ const room = Math.max(0, height - 2 * inset);
19
+ const step = width / (series.length - 1);
20
+ const round = (value) => Math.round(value * 100) / 100;
21
+ return series
22
+ .map((value, index) => {
23
+ const y = span === 0 ? height / 2 : inset + room - ((value - low) / span) * room;
24
+ return `${round(index * step)},${round(y)}`;
25
+ })
26
+ .join(' ');
27
+ }
@@ -455,3 +455,20 @@
455
455
  .pie-hatch-stripe {
456
456
  fill: var(--surface);
457
457
  }
458
+
459
+ /* A sparkline (Sparkline): the line alone, in its series colour, its
460
+ stroke kept at one width however the box scales. */
461
+ .sparkline {
462
+ display: inline-block;
463
+ flex: none;
464
+ overflow: visible;
465
+ vertical-align: middle;
466
+ }
467
+
468
+ .sparkline-line {
469
+ fill: none;
470
+ stroke-width: 1.5;
471
+ stroke-linejoin: round;
472
+ stroke-linecap: round;
473
+ vector-effect: non-scaling-stroke;
474
+ }
@@ -14,3 +14,5 @@ export { RESULT_CHART_TYPES, STACKABLE_CHART_TYPES, type ChartSeries, type Resul
14
14
  export type { ScatterAxis, ScatterAxisKind } from './Scatter.logic.js';
15
15
  export { ScatterChart, type ScatterChartProps, type ScatterPoint } from './ScatterChart.js';
16
16
  export { seriesColour } from './seriesColour.js';
17
+ export { Sparkline, type SparklineProps } from './Sparkline.js';
18
+ export { sparklinePoints } from './Sparkline.logic.js';
@@ -11,3 +11,5 @@ export { ResultChart } from './ResultChart.js';
11
11
  export { RESULT_CHART_TYPES, STACKABLE_CHART_TYPES } from './ResultChart.logic.js';
12
12
  export { ScatterChart } from './ScatterChart.js';
13
13
  export { seriesColour } from './seriesColour.js';
14
+ export { Sparkline } from './Sparkline.js';
15
+ export { sparklinePoints } from './Sparkline.logic.js';
@@ -1,6 +1,8 @@
1
1
  import type { LucideIcon } from 'lucide-react';
2
2
  import { type ReactElement, type ReactNode } from 'react';
3
+ import type { LegendSecondary } from './DialogLegend.logic.js';
3
4
  import { type DialogFact, type DialogItem, type DialogItemGroup, type DialogStatementsProps } from './DialogLists.js';
5
+ import { type DialogSize } from './ModalDialog.js';
4
6
  /**
5
7
  * A confirmation's tone: `danger` for a destructive action, `warning` for a
6
8
  * question whose yes is the safe choice but still ends work, `primary` for
@@ -61,6 +63,12 @@ export interface ConfirmDialogProps {
61
63
  * count above the same framed list. Drawn after `items`.
62
64
  */
63
65
  readonly groups?: readonly DialogItemGroup[];
66
+ /**
67
+ * The element the dialog mounts into, for a dialog that must paint above
68
+ * something it is drawn inside; the enclosing `DialogLayer` otherwise
69
+ * (`ModalDialog`'s `container`).
70
+ */
71
+ readonly container?: Element;
64
72
  /**
65
73
  * The statements the action runs (a batch of SQL), every one of them,
66
74
  * under its own short label: `{ label: 'SQL', lines }`. Drawn whole,
@@ -90,6 +98,14 @@ export interface ConfirmDialogProps {
90
98
  readonly children?: ReactNode;
91
99
  /** Extra class on the dialog box, for a body that needs its own width or layout. */
92
100
  readonly className?: string;
101
+ /** Its width step (`ModalDialog`'s `size`); none keeps the confirmation's width. */
102
+ readonly size?: DialogSize;
103
+ /**
104
+ * A second way on between leaving and confirming, on its own chord
105
+ * (Close Window and Keep Running beside Quit): drawn in the legend after
106
+ * the leave verb.
107
+ */
108
+ readonly alternative?: LegendSecondary;
93
109
  /**
94
110
  * True for a delete that cannot be undone (a volume with no Trash, a
95
111
  * server, a database): the confirm verb stays at the right edge, lit, but
@@ -125,4 +141,4 @@ export interface ConfirmDialogProps {
125
141
  * describe it. Styled by the `.confirm-dialog` rules in
126
142
  * `@bigpixelrocket/uiok/styles.css`; reads the `dialog` labels.
127
143
  */
128
- export declare function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon, tone, items, itemIcon, itemCount, groups, statements, facts, paths, children, className, forGood, confirmDisabled, onConfirm, onCancel }: ConfirmDialogProps): ReactElement;
144
+ export declare function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon, tone, items, itemIcon, itemCount, groups, statements, facts, paths, children, className, size, alternative, forGood, confirmDisabled, onConfirm, onCancel, container }: ConfirmDialogProps): ReactElement;
@@ -21,7 +21,7 @@ const DELETE_IMMEDIATELY = { key: 'Backspace', meta: true, alt: true };
21
21
  * describe it. Styled by the `.confirm-dialog` rules in
22
22
  * `@bigpixelrocket/uiok/styles.css`; reads the `dialog` labels.
23
23
  */
24
- export function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon, tone = 'danger', items, itemIcon, itemCount, groups = [], statements, facts = [], paths, children, className, forGood = false, confirmDisabled = false, onConfirm, onCancel }) {
24
+ export function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon, tone = 'danger', items, itemIcon, itemCount, groups = [], statements, facts = [], paths, children, className, size, alternative, forGood = false, confirmDisabled = false, onConfirm, onCancel, container }) {
25
25
  const labels = useLabels().dialog;
26
26
  const labelId = useId();
27
27
  const messageId = useId();
@@ -36,6 +36,7 @@ export function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon,
36
36
  const describedBy = described.length > 0 ? described.join(' ') : facts.length > 0 ? factsId : undefined;
37
37
  const legend = {
38
38
  leave: { label: cancelLabel ?? labels.cancel },
39
+ ...(alternative === undefined ? {} : { secondary: [alternative] }),
39
40
  primary: forGood
40
41
  ? {
41
42
  label: confirmLabel,
@@ -45,9 +46,9 @@ export function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon,
45
46
  }
46
47
  : { label: confirmLabel, onRun: onConfirm, disabled: confirmDisabled }
47
48
  };
48
- return (_jsxs(ModalDialog, { className: ['confirm-dialog', hasItems || hasStatements ? 'confirm-items' : null, className]
49
+ return (_jsxs(ModalDialog, { container: container, className: ['confirm-dialog', hasItems || hasStatements ? 'confirm-items' : null, className]
49
50
  .filter(Boolean)
50
- .join(' '), describedBy: describedBy, icon: icon, labelId: labelId, legend: legend, onCancel: onCancel, title: title, tone: tone === 'primary' ? 'accent' : tone, children: [hasMessage && (_jsx("p", { className: "dialog-message", id: messageId, children: message })), hasItems && (_jsxs("div", { className: "confirm-items-lists", id: itemsId, children: [list.length > 0 && _jsx(DialogItems, { count: itemCount, icon: itemIcon, items: list }), groups.map((group) => (_jsx(DialogItems, { count: group.count, icon: group.icon, items: group.items, label: group.label }, group.label)))] })), hasStatements && (_jsx(DialogStatements, { label: statements.label, lines: statements.lines, ...(statements.count === undefined ? {} : { count: statements.count }) })), facts.length > 0 && _jsx(DialogFacts, { facts: facts, id: factsId }), children] }));
51
+ .join(' '), describedBy: describedBy, icon: icon, labelId: labelId, legend: legend, onCancel: onCancel, size: size, title: title, tone: tone === 'primary' ? 'accent' : tone, children: [hasMessage && (_jsx("p", { className: "dialog-message", id: messageId, children: message })), hasItems && (_jsxs("div", { className: "confirm-items-lists", id: itemsId, children: [list.length > 0 && _jsx(DialogItems, { count: itemCount, icon: itemIcon, items: list }), groups.map((group) => (_jsx(DialogItems, { count: group.count, icon: group.icon, items: group.items, label: group.label }, group.label)))] })), hasStatements && (_jsx(DialogStatements, { label: statements.label, lines: statements.lines, ...(statements.count === undefined ? {} : { count: statements.count }) })), facts.length > 0 && _jsx(DialogFacts, { facts: facts, id: factsId }), children] }));
51
52
  }
52
53
  /**
53
54
  * A path as an item: its last part is the name, the folder that holds it
@@ -7,6 +7,12 @@ import { type DialogLegendModel } from './DialogLegend.logic.js';
7
7
  * lights its primary in it), the warning colour for a warning question.
8
8
  */
9
9
  export type DialogTone = 'accent' | 'danger' | 'warning';
10
+ /**
11
+ * A dialog's width step by what its body holds: `md` (480px) a form with a
12
+ * label column, `lg` (640px) two columns or a short list, `xl` (880px) a
13
+ * wide table or a log; none keeps the 360px of a question or a name field.
14
+ */
15
+ export type DialogSize = 'md' | 'lg' | 'xl';
10
16
  /**
11
17
  * Keeps Tab inside `container`: Tab moves to its next control and Shift-Tab
12
18
  * to its previous one, wrapping at either end, so keyboard focus cannot
@@ -38,6 +44,8 @@ export interface ModalDialogProps {
38
44
  readonly describedBy?: string;
39
45
  /** Extra class on the dialog box for dialog-specific layout (its width). */
40
46
  readonly className?: string;
47
+ /** Its width step (`dialog-size-*`); none keeps the default width. */
48
+ readonly size?: DialogSize;
41
49
  /** The verb's icon at the start of the title strip, drawn in the tone's colour. */
42
50
  readonly icon?: LucideIcon;
43
51
  /** The title strip's colour; `accent` unless given. */
@@ -104,7 +104,7 @@ export function ModalDialog({ container, ...frame }) {
104
104
  return target === undefined ? (_jsx(DialogFrame, { ...frame })) : (createPortal(_jsx(DialogFrame, { ...frame }), target));
105
105
  }
106
106
  /** The dialog itself, wherever `ModalDialog` mounts it. */
107
- function DialogFrame({ title, labelId, describedBy, className, icon: Icon, tone = 'accent', frosted = false, pinTop = false, legend, onCancel, onOutsidePress = onCancel, children }) {
107
+ function DialogFrame({ title, labelId, describedBy, className, size, icon: Icon, tone = 'accent', frosted = false, pinTop = false, legend, onCancel, onOutsidePress = onCancel, children }) {
108
108
  const dialogRef = useRef(null);
109
109
  const claimEnclosingFocus = useContext(NestedFocusContext);
110
110
  // How many dialogs nested inside this one hold the focus; a count, since
@@ -156,7 +156,9 @@ function DialogFrame({ title, labelId, describedBy, className, icon: Icon, tone
156
156
  containTab(event, dialogRef.current);
157
157
  }
158
158
  };
159
- return (_jsx("div", { className: frosted ? 'dialog-backdrop frosted' : 'dialog-backdrop', onMouseDown: onOutsidePress, children: _jsxs("div", { "aria-describedby": describedBy, "aria-labelledby": labelId, "aria-modal": "true", className: className ? `dialog ${className}` : 'dialog', "data-pinned": pinned !== null || undefined, "data-tone": tone, onKeyDown: (event) => {
159
+ return (_jsx("div", { className: frosted ? 'dialog-backdrop frosted' : 'dialog-backdrop', onMouseDown: onOutsidePress, children: _jsxs("div", { "aria-describedby": describedBy, "aria-labelledby": labelId, "aria-modal": "true", className: ['dialog', size === undefined ? null : `dialog-size-${size}`, className]
160
+ .filter(Boolean)
161
+ .join(' '), "data-pinned": pinned !== null || undefined, "data-tone": tone, onKeyDown: (event) => {
160
162
  // React bubbles events through portals, so a dialog portalled from
161
163
  // inside this one (a confirmation) must not cancel or trap here.
162
164
  if (!event.currentTarget.contains(event.target)) {
@@ -0,0 +1,40 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import { type ReactElement, type ReactNode } from 'react';
3
+ import { type RunHeaderProps } from '../run/RunHeader.js';
4
+ /** Props for {@link ProgressDialog}. */
5
+ export interface ProgressDialogProps {
6
+ /** Names the page or the action ("Export", "Install PostgreSQL 18"). */
7
+ readonly title: string;
8
+ readonly icon: LucideIcon;
9
+ /** The header: the run's state, its one-line headline, figure, bar, facts, and a failure's reason. */
10
+ readonly run: RunHeaderProps;
11
+ /** Stop was asked and the run has not settled yet: Stop dims and the headline is the caller's "Stopping…". */
12
+ readonly stopping?: boolean;
13
+ /** Ends the run; absent for a run that cannot stop. */
14
+ readonly onStop?: () => void;
15
+ /** Puts the dialog away while the run goes on; absent for a run nothing else can follow. */
16
+ readonly onBackground?: () => void;
17
+ /** OK, once the run settled; Cancel on a run that could not start. */
18
+ readonly onClose: () => void;
19
+ /** Starts the run again after it could not start (its file could not be read, say). */
20
+ readonly onTryAgain?: () => void;
21
+ /** What the body holds under the header: the run's lists, notes, or console. */
22
+ readonly children?: ReactNode;
23
+ /**
24
+ * The element the dialog mounts into, for a dialog that must paint above
25
+ * something it is drawn inside; the enclosing `DialogLayer` otherwise
26
+ * (`ModalDialog`'s `container`).
27
+ */
28
+ readonly container?: Element;
29
+ }
30
+ /**
31
+ * The progress dialog of long work: `ModalDialog` at the medium size,
32
+ * opening its body with `RunHeader`, with the legend the run's state gives:
33
+ * while it runs, Escape is Stop (dimmed while stopping) and Return is Run in
34
+ * Background where the caller can follow the run elsewhere (`onBackground`);
35
+ * settled (done, stopped, failed), OK alone on Return and Escape; a run that
36
+ * could not start (`onTryAgain` with a failed run), Cancel and Try Again.
37
+ * The header's glyph and bar carry a failure; a press outside the box
38
+ * never stops the run. Verbs from `UiokLabels.dialog`.
39
+ */
40
+ export declare function ProgressDialog({ title, icon, run, stopping, onStop, onBackground, onClose, onTryAgain, children, container }: ProgressDialogProps): ReactElement;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ import { useLabels } from '../labels/UiokProvider.js';
4
+ import { RunHeader } from '../run/RunHeader.js';
5
+ import { isSettledRun } from '../run/RunProgress.logic.js';
6
+ import { ModalDialog } from './ModalDialog.js';
7
+ /**
8
+ * The progress dialog of long work: `ModalDialog` at the medium size,
9
+ * opening its body with `RunHeader`, with the legend the run's state gives:
10
+ * while it runs, Escape is Stop (dimmed while stopping) and Return is Run in
11
+ * Background where the caller can follow the run elsewhere (`onBackground`);
12
+ * settled (done, stopped, failed), OK alone on Return and Escape; a run that
13
+ * could not start (`onTryAgain` with a failed run), Cancel and Try Again.
14
+ * The header's glyph and bar carry a failure; a press outside the box
15
+ * never stops the run. Verbs from `UiokLabels.dialog`.
16
+ */
17
+ export function ProgressDialog({ title, icon, run, stopping = false, onStop, onBackground, onClose, onTryAgain, children, container }) {
18
+ const labels = useLabels().dialog;
19
+ const labelId = useId();
20
+ const settled = isSettledRun(run.state);
21
+ const couldNotStart = onTryAgain !== undefined && run.state === 'failed';
22
+ const legend = couldNotStart
23
+ ? { leave: { label: labels.cancel }, primary: { label: labels.tryAgain, onRun: onTryAgain } }
24
+ : settled
25
+ ? { primary: { label: labels.ok, onRun: onClose } }
26
+ : {
27
+ ...(onStop === undefined ? {} : { leave: { label: labels.stop, disabled: stopping } }),
28
+ ...(onBackground === undefined
29
+ ? {}
30
+ : {
31
+ primary: { label: labels.runInBackground, onRun: onBackground, disabled: stopping }
32
+ })
33
+ };
34
+ return (_jsxs(ModalDialog, { className: "dialog-size-md", container: container, icon: icon, labelId: labelId, legend: legend, onCancel: () => {
35
+ if (settled || couldNotStart)
36
+ onClose();
37
+ else if (!stopping)
38
+ onStop?.();
39
+ }, onOutsidePress: () => undefined, title: title, children: [_jsx(RunHeader, { ...run }), children] }));
40
+ }
@@ -0,0 +1,44 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import { type ReactElement, type ReactNode } from 'react';
3
+ import { type ConfirmDialogProps } from './ConfirmDialog.js';
4
+ import type { DialogFact, DialogItem } from './DialogLists.js';
5
+ /** Props for {@link TypedNameDialog}. */
6
+ export interface TypedNameDialogProps {
7
+ /** At most five words, Title Case ("Drop Table?"). */
8
+ readonly title: string;
9
+ /** What happens and that it cannot be undone. */
10
+ readonly message: ReactNode;
11
+ /** The verb ("Drop Table"). */
12
+ readonly confirmLabel: string;
13
+ readonly icon: LucideIcon;
14
+ /** The name to type, letter case included. */
15
+ readonly name: string;
16
+ /** The field's label ("Table name"). */
17
+ readonly nameLabel: string;
18
+ readonly items?: readonly DialogItem[];
19
+ readonly itemIcon?: LucideIcon;
20
+ readonly itemCount?: number;
21
+ /** Labelled lists, each its label and count above a framed list (`ConfirmDialog`'s `groups`). */
22
+ readonly groups?: ConfirmDialogProps['groups'];
23
+ readonly statements?: ConfirmDialogProps['statements'];
24
+ /** Facts about the action (where it runs). */
25
+ readonly facts?: readonly DialogFact[];
26
+ /** What the body holds before the name field: a choice the confirmation carries, or the reasons it asks. */
27
+ readonly children?: ReactNode;
28
+ readonly onConfirm: () => void;
29
+ readonly onCancel: () => void;
30
+ /**
31
+ * The element the dialog mounts into, for a dialog that must paint above
32
+ * something it is drawn inside; the enclosing `DialogLayer` otherwise
33
+ * (`ModalDialog`'s `container`).
34
+ */
35
+ readonly container?: Element;
36
+ }
37
+ /**
38
+ * The typed-name confirmation for work that cannot be undone where a slip
39
+ * costs most: `ConfirmDialog` in the for-good anatomy (the verb on ⌥⌘⌫,
40
+ * Return doing nothing), its verb off until the field under the lists holds
41
+ * `name` exactly, letter case included. The field's note comes from
42
+ * `UiokLabels.dialog.typeName`.
43
+ */
44
+ export declare function TypedNameDialog({ name, nameLabel, children, ...confirm }: TypedNameDialogProps): ReactElement;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useState } from 'react';
3
+ import { useLabels } from '../labels/UiokProvider.js';
4
+ import { ConfirmDialog } from './ConfirmDialog.js';
5
+ /**
6
+ * The typed-name confirmation for work that cannot be undone where a slip
7
+ * costs most: `ConfirmDialog` in the for-good anatomy (the verb on ⌥⌘⌫,
8
+ * Return doing nothing), its verb off until the field under the lists holds
9
+ * `name` exactly, letter case included. The field's note comes from
10
+ * `UiokLabels.dialog.typeName`.
11
+ */
12
+ export function TypedNameDialog({ name, nameLabel, children, ...confirm }) {
13
+ const labels = useLabels().dialog;
14
+ const fieldId = useId();
15
+ const [typed, setTyped] = useState('');
16
+ return (_jsxs(ConfirmDialog, { ...confirm, confirmDisabled: typed !== name, forGood: true, tone: "danger", children: [children, _jsxs("div", { className: "field-grid", children: [_jsx("label", { className: "field-label", htmlFor: fieldId, children: nameLabel }), _jsxs("div", { className: "field-value", children: [_jsx("input", { autoComplete: "off", className: "field", id: fieldId, onChange: (event) => setTyped(event.target.value), placeholder: name, spellCheck: false, value: typed }), _jsx("p", { className: "field-note", children: labels.typeName })] })] })] }));
17
+ }
@@ -3,12 +3,15 @@
3
3
  * the rules for which slot a key runs, the one `ConfirmDialog`, the compact
4
4
  * lists a confirmation's body holds (`DialogItems` for what it acts on,
5
5
  * `DialogStatements` for the statements it runs, `DialogFacts` for facts
6
- * about the action), and the
6
+ * about the action), the `ProgressDialog` of long work, the
7
+ * `TypedNameDialog` for work a slip would cost most, and the
7
8
  * `DialogLayer` a host mounts them into.
8
9
  */
9
10
  export { ConfirmDialog, type ConfirmDialogProps, type ConfirmTone } from './ConfirmDialog.js';
10
11
  export { DialogLayer, type DialogLayerProps } from './DialogLayer.js';
12
+ export { ProgressDialog, type ProgressDialogProps } from './ProgressDialog.js';
13
+ export { TypedNameDialog, type TypedNameDialogProps } from './TypedNameDialog.js';
11
14
  export { DIALOG_ITEMS_SHOWN, DialogFacts, DialogItems, DialogStatements, shownItems, type DialogFact, type DialogFactsProps, type DialogItem, type DialogItemGroup, type DialogItemsProps, type DialogStatementsProps } from './DialogLists.js';
12
15
  export { DialogLegend, type DialogLegendProps } from './DialogLegend.js';
13
16
  export { filterLeaveLabel, legendKeyAction, legendSignature, type DialogLegendModel, type DialogLegendVerb, type LegendKeyAction, type LegendKeyStroke, type LegendPrimary, type LegendSecondary } from './DialogLegend.logic.js';
14
- export { containTab, ModalDialog, type DialogTone, type ModalDialogProps } from './ModalDialog.js';
17
+ export { containTab, ModalDialog, type DialogSize, type DialogTone, type ModalDialogProps } from './ModalDialog.js';
@@ -3,11 +3,14 @@
3
3
  * the rules for which slot a key runs, the one `ConfirmDialog`, the compact
4
4
  * lists a confirmation's body holds (`DialogItems` for what it acts on,
5
5
  * `DialogStatements` for the statements it runs, `DialogFacts` for facts
6
- * about the action), and the
6
+ * about the action), the `ProgressDialog` of long work, the
7
+ * `TypedNameDialog` for work a slip would cost most, and the
7
8
  * `DialogLayer` a host mounts them into.
8
9
  */
9
10
  export { ConfirmDialog } from './ConfirmDialog.js';
10
11
  export { DialogLayer } from './DialogLayer.js';
12
+ export { ProgressDialog } from './ProgressDialog.js';
13
+ export { TypedNameDialog } from './TypedNameDialog.js';
11
14
  export { DIALOG_ITEMS_SHOWN, DialogFacts, DialogItems, DialogStatements, shownItems } from './DialogLists.js';
12
15
  export { DialogLegend } from './DialogLegend.js';
13
16
  export { filterLeaveLabel, legendKeyAction, legendSignature } from './DialogLegend.logic.js';
@@ -1,8 +1,15 @@
1
- import { type InputHTMLAttributes } from 'react';
1
+ import { type InputHTMLAttributes, type ReactElement, type ReactNode } from 'react';
2
2
  /** Props of `Check`: a native checkbox's, with `checked` able to say "some". */
3
3
  export interface CheckProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'defaultChecked'> {
4
4
  /** On, off, or `'mixed'` for some but not all of what it stands for. */
5
5
  checked: boolean | 'mixed';
6
+ /**
7
+ * Its words, beside it in a `field-choice` label, the whole label its
8
+ * target; without them the box stands alone and needs an `aria-label`.
9
+ */
10
+ label?: ReactNode;
11
+ /** A choice whose effect is destructive (`danger`) or needs care (`warning`). */
12
+ tone?: 'danger' | 'warning';
6
13
  }
7
14
  /**
8
15
  * A checkbox in the shared `.check` look whose state can be mixed. The mixed
@@ -12,4 +19,4 @@ export interface CheckProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
12
19
  * `checked` stays `'mixed'`); everything else is the native input.
13
20
  * A plain `<input type="checkbox" class="check">` needs no component.
14
21
  */
15
- export declare function Check({ checked, className, onChange, ...props }: CheckProps): import("react").JSX.Element;
22
+ export declare function Check({ checked, className, onChange, label, tone, ...props }: CheckProps): ReactElement;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef } from 'react';
3
3
  /**
4
4
  * A checkbox in the shared `.check` look whose state can be mixed. The mixed
@@ -8,16 +8,17 @@ import { useEffect, useRef } from 'react';
8
8
  * `checked` stays `'mixed'`); everything else is the native input.
9
9
  * A plain `<input type="checkbox" class="check">` needs no component.
10
10
  */
11
- export function Check({ checked, className, onChange, ...props }) {
11
+ export function Check({ checked, className, onChange, label, tone, ...props }) {
12
12
  const ref = useRef(null);
13
13
  const mixed = checked === 'mixed';
14
14
  useEffect(() => {
15
15
  if (ref.current)
16
16
  ref.current.indeterminate = mixed;
17
17
  });
18
- return (_jsx("input", { ...props, "aria-checked": mixed ? 'mixed' : undefined, checked: checked === true, className: className ? `check ${className}` : 'check', onChange: (event) => {
18
+ const box = (_jsx("input", { ...props, "aria-checked": mixed ? 'mixed' : undefined, checked: checked === true, className: className ? `check ${className}` : 'check', onChange: (event) => {
19
19
  onChange?.(event);
20
20
  // A render the owner asks for sets the new state after this.
21
21
  event.currentTarget.indeterminate = mixed;
22
- }, ref: ref, type: "checkbox" }));
22
+ }, "data-tone": tone, ref: ref, type: "checkbox" }));
23
+ return label === undefined ? (box) : (_jsxs("label", { className: "field-choice", children: [box, label] }));
23
24
  }