@bigpixelrocket/uiok 0.2.2 → 0.3.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 (158) hide show
  1. package/CHANGELOG.md +62 -1
  2. package/dist/button/TextLink.d.ts +27 -0
  3. package/dist/button/TextLink.js +15 -0
  4. package/dist/button/button.css +48 -0
  5. package/dist/button/index.d.ts +2 -1
  6. package/dist/button/index.js +2 -1
  7. package/dist/charts/Sparkline.d.ts +20 -0
  8. package/dist/charts/Sparkline.js +12 -0
  9. package/dist/charts/Sparkline.logic.d.ts +9 -0
  10. package/dist/charts/Sparkline.logic.js +27 -0
  11. package/dist/charts/charts.css +17 -0
  12. package/dist/charts/index.d.ts +2 -0
  13. package/dist/charts/index.js +2 -0
  14. package/dist/dialog/ConfirmDialog.d.ts +17 -1
  15. package/dist/dialog/ConfirmDialog.js +10 -4
  16. package/dist/dialog/DialogLists.d.ts +8 -1
  17. package/dist/dialog/DialogLists.js +3 -2
  18. package/dist/dialog/ModalDialog.d.ts +8 -0
  19. package/dist/dialog/ModalDialog.js +4 -2
  20. package/dist/dialog/ProgressDialog.d.ts +34 -0
  21. package/dist/dialog/ProgressDialog.js +40 -0
  22. package/dist/dialog/TypedNameDialog.d.ts +36 -0
  23. package/dist/dialog/TypedNameDialog.js +17 -0
  24. package/dist/dialog/index.d.ts +5 -2
  25. package/dist/dialog/index.js +4 -1
  26. package/dist/field/Switch.d.ts +26 -0
  27. package/dist/field/Switch.js +20 -0
  28. package/dist/field/field.css +110 -2
  29. package/dist/field/index.d.ts +3 -2
  30. package/dist/field/index.js +3 -2
  31. package/dist/filter/filter.css +16 -0
  32. package/dist/frame/AppRoot.d.ts +44 -0
  33. package/dist/frame/AppRoot.js +26 -0
  34. package/dist/frame/Dock.d.ts +88 -0
  35. package/dist/frame/Dock.js +129 -0
  36. package/dist/frame/FilterChips.d.ts +28 -0
  37. package/dist/frame/FilterChips.js +14 -0
  38. package/dist/frame/PageParts.d.ts +69 -0
  39. package/dist/frame/PageParts.js +60 -0
  40. package/dist/frame/PaneSplit.d.ts +74 -0
  41. package/dist/frame/PaneSplit.js +197 -0
  42. package/dist/frame/SidebarResizer.d.ts +35 -0
  43. package/dist/frame/SidebarResizer.js +43 -0
  44. package/dist/frame/StatusNotice.d.ts +20 -0
  45. package/dist/frame/StatusNotice.js +13 -0
  46. package/dist/frame/Tree.d.ts +140 -0
  47. package/dist/frame/Tree.js +141 -0
  48. package/dist/frame/TreeToggle.d.ts +18 -0
  49. package/dist/frame/TreeToggle.js +17 -0
  50. package/dist/frame/WindowFrame.d.ts +57 -0
  51. package/dist/frame/WindowFrame.js +19 -0
  52. package/dist/frame/frame.css +801 -0
  53. package/dist/frame/index.d.ts +22 -0
  54. package/dist/frame/index.js +22 -0
  55. package/dist/frame/sharedRef.d.ts +8 -0
  56. package/dist/frame/sharedRef.js +26 -0
  57. package/dist/grid/DataGrid.d.ts +10 -2
  58. package/dist/grid/DataGrid.js +47 -13
  59. package/dist/grid/DataGrid.logic.d.ts +16 -0
  60. package/dist/grid/DataGrid.logic.js +28 -0
  61. package/dist/grid/grid.css +128 -4
  62. package/dist/index.d.ts +4 -0
  63. package/dist/index.js +4 -0
  64. package/dist/labels/UiokLabels.d.ts +6 -0
  65. package/dist/labels/UiokLabels.js +5 -1
  66. package/dist/labels/dialog.d.ts +12 -0
  67. package/dist/labels/dialog.js +7 -1
  68. package/dist/labels/index.d.ts +2 -0
  69. package/dist/labels/index.js +2 -0
  70. package/dist/labels/keys.js +2 -0
  71. package/dist/labels/paneTabs.d.ts +27 -0
  72. package/dist/labels/paneTabs.js +10 -0
  73. package/dist/labels/selectAll.d.ts +4 -1
  74. package/dist/labels/selectAll.js +1 -1
  75. package/dist/labels/settings.d.ts +46 -0
  76. package/dist/labels/settings.js +29 -0
  77. package/dist/legend/KeyLegendStrip.d.ts +9 -1
  78. package/dist/legend/KeyLegendStrip.js +119 -5
  79. package/dist/legend/legend.css +52 -0
  80. package/dist/listing/EmptyState.d.ts +40 -0
  81. package/dist/listing/EmptyState.js +14 -0
  82. package/dist/listing/Listing.d.ts +23 -5
  83. package/dist/listing/Listing.js +11 -8
  84. package/dist/listing/index.d.ts +3 -1
  85. package/dist/listing/index.js +3 -1
  86. package/dist/listing/listing.css +172 -5
  87. package/dist/log/LogWell.d.ts +34 -0
  88. package/dist/log/LogWell.js +39 -0
  89. package/dist/log/LogWell.logic.d.ts +16 -0
  90. package/dist/log/LogWell.logic.js +26 -0
  91. package/dist/log/index.d.ts +8 -0
  92. package/dist/log/index.js +8 -0
  93. package/dist/log/log.css +57 -0
  94. package/dist/pane/Pane.d.ts +49 -0
  95. package/dist/pane/Pane.js +17 -0
  96. package/dist/pane/PaneActions.d.ts +3 -1
  97. package/dist/pane/PaneActions.js +6 -5
  98. package/dist/pane/PaneKeys.d.ts +10 -3
  99. package/dist/pane/PaneKeys.js +26 -7
  100. package/dist/pane/PaneTabs.d.ts +92 -0
  101. package/dist/pane/PaneTabs.js +326 -0
  102. package/dist/pane/PaneTabs.logic.d.ts +97 -0
  103. package/dist/pane/PaneTabs.logic.js +158 -0
  104. package/dist/pane/index.d.ts +7 -1
  105. package/dist/pane/index.js +7 -1
  106. package/dist/pane/panetabs.css +408 -0
  107. package/dist/pane/usePaneKeys.js +9 -11
  108. package/dist/pane/useTabDrag.d.ts +49 -0
  109. package/dist/pane/useTabDrag.js +306 -0
  110. package/dist/segmented/SegmentedChoice.d.ts +8 -1
  111. package/dist/segmented/SegmentedChoice.js +7 -4
  112. package/dist/shell/AboutWindow.d.ts +21 -0
  113. package/dist/shell/AboutWindow.js +10 -0
  114. package/dist/shell/LanguageChoice.d.ts +27 -0
  115. package/dist/shell/LanguageChoice.js +17 -0
  116. package/dist/shell/LoadFailure.d.ts +22 -0
  117. package/dist/shell/LoadFailure.js +15 -0
  118. package/dist/shell/Lockup.d.ts +52 -0
  119. package/dist/shell/Lockup.js +30 -0
  120. package/dist/shell/SettingsDialog.d.ts +97 -0
  121. package/dist/shell/SettingsDialog.js +219 -0
  122. package/dist/shell/SettingsDialog.logic.d.ts +33 -0
  123. package/dist/shell/SettingsDialog.logic.js +42 -0
  124. package/dist/shell/SettingsFiles.d.ts +55 -0
  125. package/dist/shell/SettingsFiles.js +30 -0
  126. package/dist/shell/SettingsPageKeys.d.ts +42 -0
  127. package/dist/shell/SettingsPageKeys.js +70 -0
  128. package/dist/shell/SettingsSubsection.d.ts +34 -0
  129. package/dist/shell/SettingsSubsection.js +30 -0
  130. package/dist/shell/SignIn.d.ts +61 -0
  131. package/dist/shell/SignIn.js +36 -0
  132. package/dist/shell/ThemePicker.d.ts +74 -0
  133. package/dist/shell/ThemePicker.js +96 -0
  134. package/dist/shell/ThemePicker.logic.d.ts +13 -0
  135. package/dist/shell/ThemePicker.logic.js +26 -0
  136. package/dist/shell/TitleBar.d.ts +44 -0
  137. package/dist/shell/TitleBar.js +23 -0
  138. package/dist/shell/UpdatePill.d.ts +26 -0
  139. package/dist/shell/UpdatePill.js +17 -0
  140. package/dist/shell/Updates.d.ts +99 -0
  141. package/dist/shell/Updates.js +72 -0
  142. package/dist/shell/index.d.ts +27 -0
  143. package/dist/shell/index.js +27 -0
  144. package/dist/shell/shell.css +243 -4
  145. package/dist/styles.css +10 -0
  146. package/dist/surface/GroupSwatch.d.ts +22 -0
  147. package/dist/surface/GroupSwatch.js +15 -0
  148. package/dist/surface/Tag.d.ts +26 -0
  149. package/dist/surface/Tag.js +12 -0
  150. package/dist/surface/index.d.ts +7 -0
  151. package/dist/surface/index.js +7 -0
  152. package/dist/surface/surface.css +116 -1
  153. package/dist/themes/catalog.js +4 -0
  154. package/dist/themes/themes.generated.css +244 -0
  155. package/dist/themes/tokens.d.ts +17 -5
  156. package/dist/themes/tokens.js +75 -1
  157. package/dist/tokens.css +11 -0
  158. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,65 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.0] - 2026-11-23
10
+
11
+ ### Added
12
+
13
+ - 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`.
14
+ - 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`.
15
+ - `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.
16
+ - `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.
17
+ - `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.
18
+ - `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.
19
+ - `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).
20
+ - `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`.
21
+ - `Sparkline` and `sparklinePoints` (`@bigpixelrocket/uiok/charts`).
22
+ - `ProgressDialog` and `TypedNameDialog` (`@bigpixelrocket/uiok/dialog`).
23
+ - 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`).
24
+ - Scale tokens: `--font-weight-light`, `--font-weight-heavy`, `--shell-header-height`, `--traffic-light-inset`, `--sidebar-width`.
25
+ - The `settings` label group (`SettingsLabels`, `AppearanceLabels`, `AppearanceMode`, `DEFAULT_SETTINGS_LABELS`) and the `dialog` labels `ok`, `close`, `stop`, `tryAgain`, `runInBackground`, `typeName`.
26
+ - `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`.
27
+
28
+ ### Changed
29
+
30
+ - `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.
31
+ - 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.
32
+
33
+ ## [0.2.3] - 2026-11-22
34
+
35
+ ### Added
36
+
37
+ - `PaneTabs` (`@bigpixelrocket/uiok/pane`), the tab strip a pane hangs from: pinned, following (italic), dirty, picked, and danger-toned tabs, a mark slot and a context before the name, a pin rule, New Tab, and the strip's empty end (a double-click opens a tab). Tabs behind the front one shrink to a floor, then fold into a "+N" count with a "Folded here" menu; pinned, front, and following tabs never fold. A press brings a tab to the front and may drag it (4px slop) within its side of the pin rule, carrying any picks; Escape puts every tab back and `onReorder` gets the full order. ⌘-click and ⇧-click pick tabs (`onPick`), a middle-click closes, a double-click keeps (`onKeep`).
38
+ - Pure helpers for a host's tab state and the strip's rules: `togglePick`, `pickRun`, `pickedTabs`, `gatherTabs`, `foldOrder`, `foldsNeeded`, `tabLabelFloor`, `draggedTabOrder`.
39
+ - The `paneTabs` label group (`PaneTabsLabels`, `DEFAULT_PANE_TABS_LABELS`).
40
+ - `.pane[data-tone='danger']`: a pane's frame and its front tab's outline in `--danger`, at rest, active, and in an inactive window.
41
+ - `GroupSwatch` and `Tag` (`@bigpixelrocket/uiok/surface`, a new area): a group's colour as a filled or hollow square, and a small worded tag in a neutral, accent, ready, warning, or danger tone.
42
+ - `DataGridProps.pinnedColumns`: leading columns stay in view while the grid scrolls sideways, with a hairline at the pin edge; a column reorder never crosses it.
43
+ - The grid cell class `cell-removed`: struck out on the danger wash, for a row a save will delete.
44
+ - Field looks: `.field.value-null`, the `.field-editor` frame round a foreign editor (hover, focus, invalid, read-only, changed), and `.field-columns` with `--field-columns` for a check group in columns.
45
+ - `ListingColumn.tip`, the `info` state tone, `StateMarkProps.tip`, `RowProps.level` (an indent for a tree or a plan), the row classes `row-changed`, `row-removed`, and `drop-target`, `.row-meta.value-null`, and `.pane-message.warning`.
46
+ - `KeyLegendStripProps.overflow`: `'more'` folds the places that do not fit into a "+N" chip whose list names each folded verb with its chord and runs the one chosen. `'drop'`, the default, keeps today's behaviour.
47
+ - `TextLink` (`@bigpixelrocket/uiok/button`): a link in words, with an optional glyph, the code face, a tooltip, and a chord.
48
+ - `ConfirmDialogProps.confirmDisabled`: holds the primary off and its key inert, for a typed-name confirmation.
49
+ - `DialogStatementsProps.count` (also through `ConfirmDialog` `statements`): a host's own count words in place of the line count, or none.
50
+ - `SegmentedChoiceProps.disabled`: holds the whole choice while it cannot change.
51
+ - `RowIconActionProps.shortcut`: the chord written after the words in its tooltip.
52
+ - The invalid filter field look (an `aria-invalid="true"` input draws a danger edge and focus ring), `.overline.keep-case`, and `.notice code` in the code face.
53
+ - The `Delete` key's name and ⌦ glyph in the `keys` labels.
54
+ - `docs/tokens.md`: italic also marks a tab whose place is not fixed yet (a following tab).
55
+
56
+ ### Changed
57
+
58
+ - Every single place in `KeyLegendStrip` has a tooltip naming its verb and chord, as a paired cap's does.
59
+ - Arrow, Home, and End moves in `DataGrid` scroll the cursor's column into view sideways.
60
+
61
+ ### Fixed
62
+
63
+ - `SelectAllBar`'s default count uses thousands separators ("1,000 of 20,000 selected").
64
+ - A chosen option in a `select.field` list box (`multiple` or `size`) is no longer painted away.
65
+ - A failed `.pane-empty[role=alert]` draws its glyph in `--danger`.
66
+ - A `.notice` inside `.pane-summary` is cut with an ellipsis instead of wrapping.
67
+
9
68
  ## [0.2.2] - 2026-11-20
10
69
 
11
70
  ### Added
@@ -165,7 +224,9 @@ The first published version. The package is published to npm as `@bigpixelrocket
165
224
  - `lucide-react` 1.31 or later within 1.x is a peer dependency.
166
225
  - 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.
167
226
 
168
- [Unreleased]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.2...HEAD
227
+ [Unreleased]: https://github.com/Bigpixelrocket/uiok/compare/v0.3.0...HEAD
228
+ [0.3.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.3...v0.3.0
229
+ [0.2.3]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.2...v0.2.3
169
230
  [0.2.2]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.1...v0.2.2
170
231
  [0.2.1]: https://github.com/Bigpixelrocket/uiok/compare/v0.2.0...v0.2.1
171
232
  [0.2.0]: https://github.com/Bigpixelrocket/uiok/compare/v0.1.4...v0.2.0
@@ -0,0 +1,27 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ReactElement } from 'react';
3
+ /** Props for {@link TextLink}. */
4
+ export interface TextLinkProps {
5
+ /** The link's words, which are also its accessible name: "DROP DATABASE in the manual". */
6
+ readonly children: string;
7
+ /** What it opens: the host opens the manual page, the place, or the window. */
8
+ readonly onClick: () => void;
9
+ /** A glyph before the words (a book for a manual page), at the small icon size. */
10
+ readonly icon?: LucideIcon;
11
+ /** Sets the words in the code face, for a name or value inside a sentence. */
12
+ readonly code?: boolean;
13
+ /** The tooltip, when it says more than the words (the page's address). */
14
+ readonly tip?: string;
15
+ /** The chord that opens it, as text, written after the tooltip's words. */
16
+ readonly shortcut?: string;
17
+ }
18
+ /**
19
+ * A link in words: a button that reads as a link inside a sentence, a
20
+ * section, or a status line, for a manual page or a place a sentence names.
21
+ * It wears the accent's text colour and underlines under the pointer; it
22
+ * takes the keyboard's focus with the shared ring. It is a button because
23
+ * the host decides how to open what it names (an external browser, a tab),
24
+ * so it never navigates the page itself. Styled by `.text-link` in
25
+ * `@bigpixelrocket/uiok/styles.css`.
26
+ */
27
+ export declare function TextLink({ children, onClick, icon: Icon, code, tip, shortcut }: TextLinkProps): ReactElement;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ICON_SM } from '../icon/sizes.js';
3
+ import { tooltip } from '../tooltip/Tooltip.logic.js';
4
+ /**
5
+ * A link in words: a button that reads as a link inside a sentence, a
6
+ * section, or a status line, for a manual page or a place a sentence names.
7
+ * It wears the accent's text colour and underlines under the pointer; it
8
+ * takes the keyboard's focus with the shared ring. It is a button because
9
+ * the host decides how to open what it names (an external browser, a tab),
10
+ * so it never navigates the page itself. Styled by `.text-link` in
11
+ * `@bigpixelrocket/uiok/styles.css`.
12
+ */
13
+ export function TextLink({ children, onClick, icon: Icon, code = false, tip, shortcut }) {
14
+ return (_jsxs("button", { className: code ? 'text-link code' : 'text-link', onClick: onClick, type: "button", ...(tip === undefined && shortcut === undefined ? {} : tooltip(tip ?? children, shortcut)), children: [Icon === undefined ? null : _jsx(Icon, { "aria-hidden": true, size: ICON_SM }), _jsx("span", { className: "text-link-words", children: children })] }));
15
+ }
@@ -261,3 +261,51 @@
261
261
  .disclosure:is(:hover, :focus-visible):not(:disabled) {
262
262
  color: var(--text);
263
263
  }
264
+
265
+ /* ---- Text link (TextLink) ----
266
+
267
+ A link in words inside running text: no bezel and no ground, the
268
+ accent's text colour, the words underlined under the pointer and while
269
+ held, and the shared focus ring. Its size and face follow the text round
270
+ it; `.code` sets the words in the code face for a name or value. A glyph
271
+ before the words takes the same colour. */
272
+ .text-link {
273
+ display: inline-flex;
274
+ align-items: baseline;
275
+ gap: var(--space-2);
276
+ max-width: 100%;
277
+ margin: 0;
278
+ padding: 0;
279
+ border: none;
280
+ border-radius: var(--radius-xs);
281
+ background: none;
282
+ color: var(--accent-text);
283
+ font: inherit;
284
+ text-align: start;
285
+ cursor: default;
286
+ }
287
+
288
+ .text-link > svg {
289
+ flex: none;
290
+ align-self: center;
291
+ }
292
+
293
+ .text-link-words {
294
+ min-width: 0;
295
+ overflow: hidden;
296
+ text-overflow: ellipsis;
297
+ text-decoration-thickness: var(--line);
298
+ text-underline-offset: var(--space-1);
299
+ }
300
+
301
+ .text-link.code .text-link-words {
302
+ font-family: var(--font-mono);
303
+ }
304
+
305
+ .text-link:is(:hover, :active):not(:disabled) .text-link-words {
306
+ text-decoration-line: underline;
307
+ }
308
+
309
+ .text-link:disabled {
310
+ color: var(--text-dim);
311
+ }
@@ -1,3 +1,4 @@
1
- /** Buttons: the text `Button` in three tiers and its icon-only sibling `IconButton`. */
1
+ /** Buttons: the text `Button` in three tiers, its icon-only sibling `IconButton`, and `TextLink`, a link in words. */
2
2
  export { Button, type ButtonProps, type ButtonSize, type ButtonVariant } from './Button.js';
3
3
  export { IconButton, type IconButtonProps } from './IconButton.js';
4
+ export { TextLink, type TextLinkProps } from './TextLink.js';
@@ -1,3 +1,4 @@
1
- /** Buttons: the text `Button` in three tiers and its icon-only sibling `IconButton`. */
1
+ /** Buttons: the text `Button` in three tiers, its icon-only sibling `IconButton`, and `TextLink`, a link in words. */
2
2
  export { Button } from './Button.js';
3
3
  export { IconButton } from './IconButton.js';
4
+ export { TextLink } from './TextLink.js';
@@ -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
@@ -90,6 +92,14 @@ export interface ConfirmDialogProps {
90
92
  readonly children?: ReactNode;
91
93
  /** Extra class on the dialog box, for a body that needs its own width or layout. */
92
94
  readonly className?: string;
95
+ /** Its width step (`ModalDialog`'s `size`); none keeps the confirmation's width. */
96
+ readonly size?: DialogSize;
97
+ /**
98
+ * A second way on between leaving and confirming, on its own chord
99
+ * (Close Window and Keep Running beside Quit): drawn in the legend after
100
+ * the leave verb.
101
+ */
102
+ readonly alternative?: LegendSecondary;
93
103
  /**
94
104
  * True for a delete that cannot be undone (a volume with no Trash, a
95
105
  * server, a database): the confirm verb stays at the right edge, lit, but
@@ -98,6 +108,12 @@ export interface ConfirmDialogProps {
98
108
  * deletes anything for good.
99
109
  */
100
110
  readonly forGood?: boolean;
111
+ /**
112
+ * Holds the confirm verb off: its slot is disabled and its key runs
113
+ * nothing, until the caller lets it go (a typed-name confirmation keeps it
114
+ * off until the name in its field matches).
115
+ */
116
+ readonly confirmDisabled?: boolean;
101
117
  /** The confirm verb, on Return (or ⌥⌘⌫ with `forGood`) and its slot. */
102
118
  readonly onConfirm: () => void;
103
119
  /** Escape, the leave slot, and a press outside. */
@@ -119,4 +135,4 @@ export interface ConfirmDialogProps {
119
135
  * describe it. Styled by the `.confirm-dialog` rules in
120
136
  * `@bigpixelrocket/uiok/styles.css`; reads the `dialog` labels.
121
137
  */
122
- export declare function ConfirmDialog({ title, message, confirmLabel, cancelLabel, icon, tone, items, itemIcon, itemCount, groups, statements, facts, paths, children, className, forGood, onConfirm, onCancel }: ConfirmDialogProps): ReactElement;
138
+ 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 }: 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, 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 }) {
25
25
  const labels = useLabels().dialog;
26
26
  const labelId = useId();
27
27
  const messageId = useId();
@@ -36,13 +36,19 @@ 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
- ? { label: confirmLabel, chord: DELETE_IMMEDIATELY, onRun: onConfirm }
41
- : { label: confirmLabel, onRun: onConfirm }
41
+ ? {
42
+ label: confirmLabel,
43
+ chord: DELETE_IMMEDIATELY,
44
+ onRun: onConfirm,
45
+ disabled: confirmDisabled
46
+ }
47
+ : { label: confirmLabel, onRun: onConfirm, disabled: confirmDisabled }
42
48
  };
43
49
  return (_jsxs(ModalDialog, { className: ['confirm-dialog', hasItems || hasStatements ? 'confirm-items' : null, className]
44
50
  .filter(Boolean)
45
- .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 }), 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] }));
46
52
  }
47
53
  /**
48
54
  * A path as an item: its last part is the name, the folder that holds it
@@ -141,6 +141,13 @@ export interface DialogStatementsProps {
141
141
  readonly lines: readonly string[];
142
142
  /** The block's id, for a dialog that names it in its description. */
143
143
  readonly id?: string;
144
+ /**
145
+ * What the heading says beside the label in place of the line count: a
146
+ * host's own count ("1–100 of 101") for a block that is one page of a
147
+ * longer batch, or `null` for none, when the label already says it.
148
+ * Omitted, the block counts its lines.
149
+ */
150
+ readonly count?: string | null;
144
151
  }
145
152
  /**
146
153
  * The statements a confirmation runs (a batch of SQL), shown in full so
@@ -154,4 +161,4 @@ export interface DialogStatementsProps {
154
161
  * statement. Styled by the `.dialog-statements` rules in
155
162
  * `@bigpixelrocket/uiok/styles.css`.
156
163
  */
157
- export declare function DialogStatements({ label, lines, id }: DialogStatementsProps): ReactElement;
164
+ export declare function DialogStatements({ label, lines, id, count }: DialogStatementsProps): ReactElement;
@@ -131,7 +131,8 @@ function breakable(text) {
131
131
  * statement. Styled by the `.dialog-statements` rules in
132
132
  * `@bigpixelrocket/uiok/styles.css`.
133
133
  */
134
- export function DialogStatements({ label, lines, id }) {
134
+ export function DialogStatements({ label, lines, id, count }) {
135
135
  const labelId = useId();
136
- return (_jsxs("div", { className: "dialog-statements-block", id: id, children: [_jsxs("div", { className: "dialog-items-head", children: [_jsx("span", { className: "dialog-label", id: labelId, children: label }), _jsx("span", { className: "dialog-items-count", children: lines.length.toLocaleString() })] }), _jsx("div", { className: "dialog-statements-frame", children: _jsx("div", { "aria-labelledby": labelId, className: "dialog-statements scroll-fade", role: "region", tabIndex: 0, children: _jsx("ol", { children: lines.map((line, index) => (_jsx("li", { className: "dialog-statement", children: _jsx("code", { dir: "ltr", children: line }) }, `${index}:${line}`))) }) }) })] }));
136
+ const shownCount = count === undefined ? lines.length.toLocaleString() : count;
137
+ return (_jsxs("div", { className: "dialog-statements-block", id: id, children: [_jsxs("div", { className: "dialog-items-head", children: [_jsx("span", { className: "dialog-label", id: labelId, children: label }), shownCount === null ? null : _jsx("span", { className: "dialog-items-count", children: shownCount })] }), _jsx("div", { className: "dialog-statements-frame", children: _jsx("div", { "aria-labelledby": labelId, className: "dialog-statements scroll-fade", role: "region", tabIndex: 0, children: _jsx("ol", { children: lines.map((line, index) => (_jsx("li", { className: "dialog-statement", children: _jsx("code", { dir: "ltr", children: line }) }, `${index}:${line}`))) }) }) })] }));
137
138
  }
@@ -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,34 @@
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
+ /**
25
+ * The progress dialog of long work: `ModalDialog` at the medium size,
26
+ * opening its body with `RunHeader`, with the legend the run's state gives:
27
+ * while it runs, Escape is Stop (dimmed while stopping) and Return is Run in
28
+ * Background where the caller can follow the run elsewhere (`onBackground`);
29
+ * settled (done, stopped, failed), OK alone on Return and Escape; a run that
30
+ * could not start (`onTryAgain` with a failed run), Cancel and Try Again.
31
+ * The header's glyph and bar carry a failure; a press outside the box
32
+ * never stops the run. Verbs from `UiokLabels.dialog`.
33
+ */
34
+ export declare function ProgressDialog({ title, icon, run, stopping, onStop, onBackground, onClose, onTryAgain, children }: 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 }) {
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", 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,36 @@
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
+ readonly statements?: ConfirmDialogProps['statements'];
22
+ /** Facts about the action (where it runs). */
23
+ readonly facts?: readonly DialogFact[];
24
+ /** What the body holds before the name field: a choice the confirmation carries, or the reasons it asks. */
25
+ readonly children?: ReactNode;
26
+ readonly onConfirm: () => void;
27
+ readonly onCancel: () => void;
28
+ }
29
+ /**
30
+ * The typed-name confirmation for work that cannot be undone where a slip
31
+ * costs most: `ConfirmDialog` in the for-good anatomy (the verb on ⌥⌘⌫,
32
+ * Return doing nothing), its verb off until the field under the lists holds
33
+ * `name` exactly, letter case included. The field's note comes from
34
+ * `UiokLabels.dialog.typeName`.
35
+ */
36
+ 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';