@bigpixelrocket/uiok 0.3.0 → 0.5.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 (178) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/dist/button/TextLink.d.ts +19 -3
  3. package/dist/button/TextLink.js +4 -3
  4. package/dist/dialog/ConfirmDialog.d.ts +7 -1
  5. package/dist/dialog/ConfirmDialog.js +2 -2
  6. package/dist/dialog/ModalDialog.js +8 -2
  7. package/dist/dialog/ProgressDialog.d.ts +7 -1
  8. package/dist/dialog/ProgressDialog.js +2 -2
  9. package/dist/dialog/TypedNameDialog.d.ts +8 -0
  10. package/dist/field/Check.d.ts +9 -2
  11. package/dist/field/Check.js +5 -4
  12. package/dist/field/Controls.d.ts +198 -0
  13. package/dist/field/Controls.js +94 -0
  14. package/dist/field/FieldLayout.d.ts +126 -0
  15. package/dist/field/FieldLayout.js +89 -0
  16. package/dist/field/index.d.ts +9 -6
  17. package/dist/field/index.js +9 -6
  18. package/dist/frame/Dock.js +1 -1
  19. package/dist/frame/SidebarResizer.js +1 -1
  20. package/dist/frame/Tree.d.ts +17 -4
  21. package/dist/frame/Tree.js +34 -9
  22. package/dist/frame/WindowFrame.js +2 -1
  23. package/dist/frame/frame.css +26 -4
  24. package/dist/icon/ProductMark.d.ts +57 -0
  25. package/dist/icon/ProductMark.js +26 -0
  26. package/dist/icon/icon.css +53 -0
  27. package/dist/icon/index.d.ts +3 -1
  28. package/dist/icon/index.js +3 -1
  29. package/dist/labels/UiokLabels.d.ts +3 -0
  30. package/dist/labels/UiokLabels.js +3 -1
  31. package/dist/labels/index.d.ts +1 -0
  32. package/dist/labels/index.js +1 -0
  33. package/dist/labels/settings.d.ts +6 -0
  34. package/dist/labels/settings.js +1 -0
  35. package/dist/labels/viewer.d.ts +193 -0
  36. package/dist/labels/viewer.js +124 -0
  37. package/dist/listing/Listing.d.ts +60 -4
  38. package/dist/listing/Listing.js +39 -10
  39. package/dist/listing/ListingScope.d.ts +7 -0
  40. package/dist/listing/ListingScope.js +8 -0
  41. package/dist/listing/PaneMessage.d.ts +28 -0
  42. package/dist/listing/PaneMessage.js +12 -0
  43. package/dist/listing/Timeline.d.ts +51 -0
  44. package/dist/listing/Timeline.js +28 -0
  45. package/dist/listing/index.d.ts +7 -3
  46. package/dist/listing/index.js +6 -2
  47. package/dist/listing/listing.css +185 -22
  48. package/dist/log/Ansi.logic.d.ts +27 -0
  49. package/dist/log/Ansi.logic.js +203 -0
  50. package/dist/log/LogWell.d.ts +11 -2
  51. package/dist/log/LogWell.js +15 -3
  52. package/dist/log/index.d.ts +1 -0
  53. package/dist/log/index.js +1 -0
  54. package/dist/log/log.css +80 -0
  55. package/dist/menu/Menu.d.ts +89 -0
  56. package/dist/menu/Menu.js +143 -0
  57. package/dist/menu/Menu.logic.d.ts +56 -0
  58. package/dist/menu/Menu.logic.js +64 -0
  59. package/dist/menu/index.d.ts +5 -1
  60. package/dist/menu/index.js +5 -1
  61. package/dist/menu/menu.css +51 -0
  62. package/dist/palette/Palette.d.ts +3 -2
  63. package/dist/palette/Palette.js +8 -4
  64. package/dist/palette/PaletteRows.d.ts +129 -0
  65. package/dist/palette/PaletteRows.js +74 -0
  66. package/dist/palette/index.d.ts +5 -2
  67. package/dist/palette/index.js +5 -2
  68. package/dist/pane/PaneFrame.d.ts +22 -1
  69. package/dist/pane/PaneFrame.js +42 -5
  70. package/dist/pane/index.d.ts +1 -1
  71. package/dist/shell/SettingsDialog.d.ts +20 -2
  72. package/dist/shell/SettingsDialog.js +13 -3
  73. package/dist/shell/index.d.ts +1 -1
  74. package/dist/styles.css +4 -0
  75. package/dist/surface/Card.d.ts +18 -0
  76. package/dist/surface/Card.js +10 -0
  77. package/dist/surface/FactTable.d.ts +44 -0
  78. package/dist/surface/FactTable.js +33 -0
  79. package/dist/surface/Notice.d.ts +45 -0
  80. package/dist/surface/Notice.js +27 -0
  81. package/dist/surface/index.d.ts +7 -3
  82. package/dist/surface/index.js +7 -3
  83. package/dist/surface/surface.css +64 -0
  84. package/dist/tabs/PageTabs.d.ts +6 -0
  85. package/dist/tabs/PageTabs.js +1 -1
  86. package/dist/tabs/tabs.css +14 -0
  87. package/dist/terminal/TerminalBox.d.ts +30 -0
  88. package/dist/terminal/TerminalBox.js +17 -0
  89. package/dist/terminal/index.d.ts +3 -1
  90. package/dist/terminal/index.js +3 -1
  91. package/dist/terminal/terminal.css +29 -0
  92. package/dist/themes/themes.generated.css +21 -0
  93. package/dist/themes/tokens.d.ts +1 -0
  94. package/dist/themes/tokens.js +16 -1
  95. package/dist/viewer/AudioView.d.ts +13 -0
  96. package/dist/viewer/AudioView.js +25 -0
  97. package/dist/viewer/HexJump.logic.d.ts +16 -0
  98. package/dist/viewer/HexJump.logic.js +27 -0
  99. package/dist/viewer/HexRows.logic.d.ts +55 -0
  100. package/dist/viewer/HexRows.logic.js +84 -0
  101. package/dist/viewer/HexSelection.logic.d.ts +57 -0
  102. package/dist/viewer/HexSelection.logic.js +68 -0
  103. package/dist/viewer/HexView.d.ts +10 -0
  104. package/dist/viewer/HexView.js +291 -0
  105. package/dist/viewer/HexViewport.logic.d.ts +61 -0
  106. package/dist/viewer/HexViewport.logic.js +79 -0
  107. package/dist/viewer/ImageView.d.ts +19 -0
  108. package/dist/viewer/ImageView.js +230 -0
  109. package/dist/viewer/ImageZoom.logic.d.ts +65 -0
  110. package/dist/viewer/ImageZoom.logic.js +119 -0
  111. package/dist/viewer/LatestRead.logic.d.ts +27 -0
  112. package/dist/viewer/LatestRead.logic.js +55 -0
  113. package/dist/viewer/MediaControls.d.ts +25 -0
  114. package/dist/viewer/MediaControls.js +183 -0
  115. package/dist/viewer/MediaPlayer.logic.d.ts +53 -0
  116. package/dist/viewer/MediaPlayer.logic.js +68 -0
  117. package/dist/viewer/PdfView.d.ts +23 -0
  118. package/dist/viewer/PdfView.js +25 -0
  119. package/dist/viewer/QuietFocus.d.ts +19 -0
  120. package/dist/viewer/QuietFocus.js +27 -0
  121. package/dist/viewer/ScaledScroll.logic.d.ts +30 -0
  122. package/dist/viewer/ScaledScroll.logic.js +28 -0
  123. package/dist/viewer/ScaledScrollbar.d.ts +19 -0
  124. package/dist/viewer/ScaledScrollbar.js +71 -0
  125. package/dist/viewer/SyntaxHighlighter.d.ts +29 -0
  126. package/dist/viewer/SyntaxHighlighter.js +144 -0
  127. package/dist/viewer/SyntaxLanguage.logic.d.ts +110 -0
  128. package/dist/viewer/SyntaxLanguage.logic.js +283 -0
  129. package/dist/viewer/SyntaxService.d.ts +75 -0
  130. package/dist/viewer/SyntaxService.js +49 -0
  131. package/dist/viewer/SyntaxSession.logic.d.ts +78 -0
  132. package/dist/viewer/SyntaxSession.logic.js +221 -0
  133. package/dist/viewer/SyntaxWorker.d.ts +6 -0
  134. package/dist/viewer/SyntaxWorker.js +8 -0
  135. package/dist/viewer/TextEncoding.logic.d.ts +35 -0
  136. package/dist/viewer/TextEncoding.logic.js +58 -0
  137. package/dist/viewer/TextRows.logic.d.ts +86 -0
  138. package/dist/viewer/TextRows.logic.js +241 -0
  139. package/dist/viewer/TextSelection.logic.d.ts +97 -0
  140. package/dist/viewer/TextSelection.logic.js +139 -0
  141. package/dist/viewer/TextView.d.ts +13 -0
  142. package/dist/viewer/TextView.js +448 -0
  143. package/dist/viewer/TextViewport.logic.d.ts +70 -0
  144. package/dist/viewer/TextViewport.logic.js +116 -0
  145. package/dist/viewer/VideoView.d.ts +18 -0
  146. package/dist/viewer/VideoView.js +53 -0
  147. package/dist/viewer/ViewerClipboard.d.ts +30 -0
  148. package/dist/viewer/ViewerClipboard.js +70 -0
  149. package/dist/viewer/ViewerFrame.logic.d.ts +61 -0
  150. package/dist/viewer/ViewerFrame.logic.js +130 -0
  151. package/dist/viewer/ViewerKeys.d.ts +16 -0
  152. package/dist/viewer/ViewerKeys.js +14 -0
  153. package/dist/viewer/ViewerScope.d.ts +12 -0
  154. package/dist/viewer/ViewerScope.js +22 -0
  155. package/dist/viewer/ViewerViews.d.ts +28 -0
  156. package/dist/viewer/ViewerViews.js +22 -0
  157. package/dist/viewer/ViewerWindow.d.ts +53 -0
  158. package/dist/viewer/ViewerWindow.js +219 -0
  159. package/dist/viewer/index.d.ts +12 -0
  160. package/dist/viewer/index.js +12 -0
  161. package/dist/viewer/types.d.ts +151 -0
  162. package/dist/viewer/types.js +26 -0
  163. package/dist/viewer/useElementHeight.d.ts +6 -0
  164. package/dist/viewer/useElementHeight.js +22 -0
  165. package/dist/viewer/useElementSize.d.ts +7 -0
  166. package/dist/viewer/useElementSize.js +24 -0
  167. package/dist/viewer/useEscapeToClear.d.ts +8 -0
  168. package/dist/viewer/useEscapeToClear.js +26 -0
  169. package/dist/viewer/useHexDocument.d.ts +41 -0
  170. package/dist/viewer/useHexDocument.js +144 -0
  171. package/dist/viewer/useMediaElement.d.ts +10 -0
  172. package/dist/viewer/useMediaElement.js +24 -0
  173. package/dist/viewer/useSyntaxHighlight.d.ts +24 -0
  174. package/dist/viewer/useSyntaxHighlight.js +133 -0
  175. package/dist/viewer/useTextDocument.d.ts +66 -0
  176. package/dist/viewer/useTextDocument.js +245 -0
  177. package/dist/viewer/viewer.css +645 -0
  178. package/package.json +7 -1
@@ -3,9 +3,9 @@ import { CircleAlert, Settings } from 'lucide-react';
3
3
  import { Fragment, useEffect, useLayoutEffect, useRef, useState } from 'react';
4
4
  import { Button } from '../button/Button.js';
5
5
  import { ModalDialog } from '../dialog/ModalDialog.js';
6
- import { ICON_MD } from '../icon/sizes.js';
6
+ import { ICON_MD, ICON_SM } from '../icon/sizes.js';
7
7
  import { useLabels } from '../labels/UiokProvider.js';
8
- import { cutTooltip } from '../tooltip/Tooltip.logic.js';
8
+ import { cutTooltip, tooltip } from '../tooltip/Tooltip.logic.js';
9
9
  import { spiedSubsection, subsectionScrollTop } from './SettingsDialog.logic.js';
10
10
  import { SettingsPageKeysContext, settingsLegend } from './SettingsPageKeys.js';
11
11
  import { SETTINGS_PAGE_HEAD_ATTRIBUTE, SETTINGS_REVEAL_ATTRIBUTE, SETTINGS_SUBSECTION_ATTRIBUTE } from './SettingsSubsection.js';
@@ -111,7 +111,17 @@ const keepFocus = (event) => event.preventDefault();
111
111
  */
112
112
  function SettingsSidebar({ groups, page, subsectionId, onPage, onSubsection }) {
113
113
  const labels = useLabels().settings;
114
- return (_jsx("nav", { "aria-label": labels.sidebar, className: "settings-sidebar scroll-fade", children: groups.map((group) => (_jsxs("div", { "aria-labelledby": `settings-group-${group.id}`, className: "settings-sidebar-group", role: "group", children: [_jsx("span", { className: "settings-sidebar-header overline", id: `settings-group-${group.id}`, children: group.title }), group.pages.map((item) => (_jsxs(Fragment, { children: [_jsxs("button", { "aria-current": item.id === page.id ? 'page' : undefined, className: "settings-sidebar-page", "data-settings-page": item.id, onClick: () => onPage(item.id), onMouseDown: keepFocus, type: "button", children: [_jsx(item.Icon, { "aria-hidden": true, size: ICON_MD }), _jsx("span", { ...cutTooltip(item.title), children: item.title }), item.chip ? _jsx("span", { className: "settings-sidebar-chip", children: item.chip }) : null] }), item.id === page.id && item.subsections.length > 0 ? (_jsx("div", { className: "settings-sidebar-subsections", children: item.subsections.map((subsection) => (_jsx("button", { "aria-current": subsection.id === subsectionId ? 'location' : undefined, className: "settings-sidebar-subsection", onClick: () => onSubsection(subsection.id), onMouseDown: keepFocus, type: "button", ...cutTooltip(subsection.title), children: subsection.title }, subsection.id))) })) : null] }, item.id)))] }, group.id))) }));
114
+ return (_jsx("nav", { "aria-label": labels.sidebar, className: "settings-sidebar scroll-fade", children: groups.map((group) => (_jsxs("div", { "aria-labelledby": `settings-group-${group.id}`, className: "settings-sidebar-group", role: "group", children: [_jsx("span", { className: "settings-sidebar-header overline", id: `settings-group-${group.id}`, children: group.title }), group.pages.map((item) => {
115
+ const chip = item.chip === undefined || item.chip === null || item.chip === ''
116
+ ? null
117
+ : typeof item.chip === 'string'
118
+ ? { text: item.chip }
119
+ : item.chip;
120
+ const ChipIcon = chip?.icon;
121
+ return (_jsxs(Fragment, { children: [_jsxs("button", { "aria-current": item.id === page.id ? 'page' : undefined, "aria-label": chip === null
122
+ ? undefined
123
+ : labels.pageWithChip(item.title, chip.tip ?? chip.text), className: "settings-sidebar-page", "data-settings-page": item.id, onClick: () => onPage(item.id), onMouseDown: keepFocus, type: "button", children: [_jsx(item.Icon, { "aria-hidden": true, size: ICON_MD }), _jsx("span", { ...cutTooltip(item.title), children: item.title }), chip === null ? null : (_jsxs("span", { className: "settings-sidebar-chip", ...(chip.tip === undefined ? {} : tooltip(chip.tip)), children: [ChipIcon === undefined ? null : _jsx(ChipIcon, { "aria-hidden": true, size: ICON_SM }), chip.text] }))] }), item.id === page.id && item.subsections.length > 0 ? (_jsx("div", { className: "settings-sidebar-subsections", children: item.subsections.map((subsection) => (_jsx("button", { "aria-current": subsection.id === subsectionId ? 'location' : undefined, className: "settings-sidebar-subsection", onClick: () => onSubsection(subsection.id), onMouseDown: keepFocus, type: "button", ...cutTooltip(subsection.title), children: subsection.title }, subsection.id))) })) : null] }, item.id));
124
+ })] }, group.id))) }));
115
125
  }
116
126
  /**
117
127
  * The Settings dialog: a fixed frame on the frosted wash, the sidebar of
@@ -14,7 +14,7 @@ export { AboutWindow, type AboutWindowProps } from './AboutWindow.js';
14
14
  export { LanguageChoice, type LanguageChoiceProps, type LanguageOption } from './LanguageChoice.js';
15
15
  export { LoadFailure, type LoadFailureProps } from './LoadFailure.js';
16
16
  export { BrandMark, Lockup, type BrandMarkLook, type BrandMarkProps, type BrandMarkShape, type LockupProps, type LockupSize } from './Lockup.js';
17
- export { SettingsDialog, SettingsSaveFailure, type SettingsDialogProps, type SettingsGroup, type SettingsPage, type SettingsPageRequest, type SettingsSaveFailureProps, type SettingsSubsectionEntry } from './SettingsDialog.js';
17
+ export { SettingsDialog, SettingsSaveFailure, type SettingsDialogProps, type SettingsGroup, type SettingsChip, type SettingsPage, type SettingsPageRequest, type SettingsSaveFailureProps, type SettingsSubsectionEntry } from './SettingsDialog.js';
18
18
  export { spiedSubsection, SUBSECTION_SCROLL_INSET_PX, SUBSECTION_SPY_SLACK_PX, subsectionScrollTop, type SettingsScrollView, type SubsectionAnchor } from './SettingsDialog.logic.js';
19
19
  export { SettingsFiles, type SettingsFileEntry, type SettingsFileProblem, type SettingsFileRequest, type SettingsFilesProps } from './SettingsFiles.js';
20
20
  export { SettingsPageKeysContext, settingsLegend, useSettingsPageKeys, type SettingsPageKeys } from './SettingsPageKeys.js';
package/dist/styles.css CHANGED
@@ -7,6 +7,7 @@
7
7
  @import './tokens.css';
8
8
 
9
9
  /* Component stylesheets, each beside its component. */
10
+ @import './icon/icon.css';
10
11
  @import './button/button.css';
11
12
  @import './tooltip/tooltip.css';
12
13
  @import './activity/activity.css';
@@ -39,6 +40,9 @@
39
40
  @import './shell/shell.css';
40
41
  @import './frame/frame.css';
41
42
  @import './log/log.css';
43
+ /* The file viewer (@bigpixelrocket/uiok/viewer): its header, text, hex,
44
+ image, and media views. */
45
+ @import './viewer/viewer.css';
42
46
 
43
47
  /* ---- What the browser would otherwise draw in its own colours ---- */
44
48
 
@@ -0,0 +1,18 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /** Props for {@link Card}. */
3
+ export interface CardProps {
4
+ /** One subject's lines: a heading, facts, a field grid, actions. */
5
+ readonly children: ReactNode;
6
+ /**
7
+ * The card's accessible name, which makes it a `region` landmark; leave
8
+ * it out for a card that is one part of a page among many alike.
9
+ */
10
+ readonly label?: string;
11
+ }
12
+ /**
13
+ * A lifted panel that groups one subject's lines (an account, an update, a
14
+ * connection's summary), framed like every framed surface, at the surface
15
+ * inset at both ends whatever margins its first and last children bring.
16
+ * Draws `.card`.
17
+ */
18
+ export declare function Card({ children, label }: CardProps): ReactElement;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * A lifted panel that groups one subject's lines (an account, an update, a
4
+ * connection's summary), framed like every framed surface, at the surface
5
+ * inset at both ends whatever margins its first and last children bring.
6
+ * Draws `.card`.
7
+ */
8
+ export function Card({ children, label }) {
9
+ return label === undefined ? (_jsx("div", { className: "card", children: children })) : (_jsx("section", { "aria-label": label, className: "card", children: children }));
10
+ }
@@ -0,0 +1,44 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /**
3
+ * Where a fact stands: `ready` found and working, `warning` found but
4
+ * needing a look, `danger` missing or failing, `muted` not checked or not
5
+ * in use.
6
+ */
7
+ export type FactTone = 'ready' | 'warning' | 'danger' | 'muted';
8
+ /** Props for {@link FactTable}. */
9
+ export interface FactTableProps {
10
+ /** The table's accessible name: "Tools". */
11
+ readonly label: string;
12
+ /** Its rows (`FactRow`). */
13
+ readonly children: ReactNode;
14
+ }
15
+ /**
16
+ * A short table of facts on a settings page or a detail page, one thing a
17
+ * row: the state glyph of each, its name, a detail (where it is, in the
18
+ * code face), and a value at the row's end (a version, "found"), the
19
+ * columns aligned across the rows and ruled by hairlines above, between,
20
+ * and under them. For what a page checks and reports, not for what the user
21
+ * edits (a `FieldRow`'s) or a list the keys move through (a `Listing`).
22
+ * Draws `.fact-table` with `role="table"`.
23
+ */
24
+ export declare function FactTable({ label, children }: FactTableProps): ReactElement;
25
+ /** Props for {@link FactRow}. */
26
+ export interface FactRowProps {
27
+ /** Where the fact stands, which picks its glyph and the glyph's tone. */
28
+ readonly tone: FactTone;
29
+ /** The state in words, the glyph's accessible name and tooltip: "Found", "Missing". */
30
+ readonly toneLabel: string;
31
+ /** What the fact is about: "Homebrew". */
32
+ readonly name: string;
33
+ /** Where it is, or how it is found, in the code face: a path, a command. A string cut short shows whole in its tooltip. */
34
+ readonly detail?: ReactNode;
35
+ /** The value at the row's end, in the code face: a version, "found". */
36
+ readonly value?: ReactNode;
37
+ }
38
+ /**
39
+ * One row of a `FactTable`: its state glyph in the state's text tone (a
40
+ * check, a warning triangle, a cross, or a dashed ring, each a shape of its
41
+ * own), the name in the interface face, the detail and the value in the
42
+ * code face, the value right-aligned. The words can be swept and copied.
43
+ */
44
+ export declare function FactRow({ tone, toneLabel, name, detail, value }: FactRowProps): ReactElement;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CircleCheck, CircleDashed, CircleX, TriangleAlert } from 'lucide-react';
3
+ import { ICON_MD } from '../icon/sizes.js';
4
+ import { cutTooltip, tooltip } from '../tooltip/Tooltip.logic.js';
5
+ /** Each tone's glyph: a shape of its own, so a fact's state reads without its hue. */
6
+ const GLYPHS = {
7
+ ready: CircleCheck,
8
+ warning: TriangleAlert,
9
+ danger: CircleX,
10
+ muted: CircleDashed
11
+ };
12
+ /**
13
+ * A short table of facts on a settings page or a detail page, one thing a
14
+ * row: the state glyph of each, its name, a detail (where it is, in the
15
+ * code face), and a value at the row's end (a version, "found"), the
16
+ * columns aligned across the rows and ruled by hairlines above, between,
17
+ * and under them. For what a page checks and reports, not for what the user
18
+ * edits (a `FieldRow`'s) or a list the keys move through (a `Listing`).
19
+ * Draws `.fact-table` with `role="table"`.
20
+ */
21
+ export function FactTable({ label, children }) {
22
+ return (_jsx("div", { "aria-label": label, className: "fact-table", role: "table", children: children }));
23
+ }
24
+ /**
25
+ * One row of a `FactTable`: its state glyph in the state's text tone (a
26
+ * check, a warning triangle, a cross, or a dashed ring, each a shape of its
27
+ * own), the name in the interface face, the detail and the value in the
28
+ * code face, the value right-aligned. The words can be swept and copied.
29
+ */
30
+ export function FactRow({ tone, toneLabel, name, detail, value }) {
31
+ const Glyph = GLYPHS[tone];
32
+ return (_jsxs("div", { className: "fact-row", "data-tone": tone, role: "row", children: [_jsx("span", { className: "fact-state", role: "cell", children: _jsx(Glyph, { "aria-label": toneLabel, role: "img", size: ICON_MD, ...tooltip(toneLabel) }) }), _jsx("span", { className: "fact-name", role: "cell", ...cutTooltip(name), children: name }), _jsx("span", { className: "fact-detail", role: "cell", ...(typeof detail === 'string' ? cutTooltip(detail) : {}), children: detail }), _jsx("span", { className: "fact-value", role: "cell", children: value })] }));
33
+ }
@@ -0,0 +1,45 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ /**
3
+ * A notice's tone: `note` a plain fact, `success` a step that worked,
4
+ * `warning` a state that needs a second look, `danger` a failure.
5
+ */
6
+ export type NoticeTone = 'note' | 'success' | 'warning' | 'danger';
7
+ /** Props for {@link Notice}. */
8
+ export interface NoticeProps {
9
+ /** The words: a sentence, which may hold `<code>` for a server's or a system's own words. */
10
+ readonly children: ReactNode;
11
+ /** The tone; `note` by default. */
12
+ readonly tone?: NoticeTone;
13
+ /**
14
+ * What leads the line: by default the tone's glyph (Info, CircleCheck,
15
+ * TriangleAlert, CircleAlert); another node in its place (a `Spinner`
16
+ * while work runs); or `null` for none.
17
+ */
18
+ readonly glyph?: ReactNode;
19
+ /** Small buttons after the words, centred on their first line (a Reload, a Retry). */
20
+ readonly actions?: ReactNode;
21
+ /**
22
+ * Sets the notice as the window's status line under a header: one line at
23
+ * the window's inset with a hairline under it, its words cut with an
24
+ * ellipsis in a narrow window and given whole as a tooltip. Give
25
+ * `cutText` the words as plain text for that tooltip.
26
+ */
27
+ readonly band?: boolean;
28
+ /** The words as plain text, for the tooltip a `band` shows while it cuts them. */
29
+ readonly cutText?: string;
30
+ /**
31
+ * The live-region role: `status` (the default) for a line assistive
32
+ * technology reads when it changes, `alert` for a failure it reads at
33
+ * once, or `null` for a notice that is part of the page as it loads.
34
+ */
35
+ readonly role?: 'status' | 'alert' | null;
36
+ }
37
+ /**
38
+ * An application's status line, never a web page's alert: a small glyph in
39
+ * the tone's colour, the words in the text colour, and optional small
40
+ * buttons after them, with no fill, frame, or side bar. It sits on the
41
+ * surface it is about (a step, a field, a pane), or, as a `band`, under a
42
+ * window's header until its cause goes. Draws `.notice` (`.notice-danger`,
43
+ * `.notice-warning`, `.notice-success`, `.notice-card`).
44
+ */
45
+ export declare function Notice({ children, tone, glyph, actions, band, cutText, role }: NoticeProps): ReactElement;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CircleAlert, CircleCheck, Info, TriangleAlert } from 'lucide-react';
3
+ import { ICON_MD } from '../icon/sizes.js';
4
+ import { cutTooltip } from '../tooltip/Tooltip.logic.js';
5
+ const TONE_GLYPH = {
6
+ note: Info,
7
+ success: CircleCheck,
8
+ warning: TriangleAlert,
9
+ danger: CircleAlert
10
+ };
11
+ /**
12
+ * An application's status line, never a web page's alert: a small glyph in
13
+ * the tone's colour, the words in the text colour, and optional small
14
+ * buttons after them, with no fill, frame, or side bar. It sits on the
15
+ * surface it is about (a step, a field, a pane), or, as a `band`, under a
16
+ * window's header until its cause goes. Draws `.notice` (`.notice-danger`,
17
+ * `.notice-warning`, `.notice-success`, `.notice-card`).
18
+ */
19
+ export function Notice({ children, tone = 'note', glyph, actions, band = false, cutText, role = 'status' }) {
20
+ const Glyph = TONE_GLYPH[tone];
21
+ const classes = ['notice'];
22
+ if (tone !== 'note')
23
+ classes.push(`notice-${tone}`);
24
+ if (band)
25
+ classes.push('notice-card');
26
+ return (_jsxs("div", { className: classes.join(' '), role: role ?? undefined, children: [glyph === undefined ? (_jsx(Glyph, { "aria-hidden": true, size: ICON_MD })) : glyph === null ? null : (_jsx("span", { "aria-hidden": true, className: "notice-glyph", children: glyph })), _jsx("span", { className: "notice-text", ...(band ? cutTooltip(cutText) : {}), children: children }), actions ? _jsx("span", { className: "notice-actions", children: actions }) : null] }));
27
+ }
@@ -1,7 +1,11 @@
1
1
  /**
2
- * Surfaces: `GroupSwatch`, a group's colour beside its name, and `Tag`, a
3
- * small worded tag in a tone. The notice and card looks of this area are
4
- * classes in `@bigpixelrocket/uiok/styles.css`, with no module.
2
+ * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
+ * lifted panel for one subject's lines; `FactTable` of `FactRow`s, a page's
4
+ * short table of facts with a state glyph each; `GroupSwatch`, a group's
5
+ * colour beside its name; and `Tag`, a small worded tag in a tone.
5
6
  */
7
+ export { Card, type CardProps } from './Card.js';
8
+ export { FactRow, FactTable, type FactRowProps, type FactTableProps, type FactTone } from './FactTable.js';
9
+ export { Notice, type NoticeProps, type NoticeTone } from './Notice.js';
6
10
  export { GroupSwatch, type GroupSwatchProps } from './GroupSwatch.js';
7
11
  export { Tag, type TagProps, type TagTone } from './Tag.js';
@@ -1,7 +1,11 @@
1
1
  /**
2
- * Surfaces: `GroupSwatch`, a group's colour beside its name, and `Tag`, a
3
- * small worded tag in a tone. The notice and card looks of this area are
4
- * classes in `@bigpixelrocket/uiok/styles.css`, with no module.
2
+ * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
+ * lifted panel for one subject's lines; `FactTable` of `FactRow`s, a page's
4
+ * short table of facts with a state glyph each; `GroupSwatch`, a group's
5
+ * colour beside its name; and `Tag`, a small worded tag in a tone.
5
6
  */
7
+ export { Card } from './Card.js';
8
+ export { FactRow, FactTable } from './FactTable.js';
9
+ export { Notice } from './Notice.js';
6
10
  export { GroupSwatch } from './GroupSwatch.js';
7
11
  export { Tag } from './Tag.js';
@@ -267,3 +267,67 @@
267
267
  letter-spacing: var(--tracking-caps);
268
268
  text-transform: uppercase;
269
269
  }
270
+
271
+ /* ---- Fact table (FactTable, FactRow) ----
272
+
273
+ A short table of facts on a page: a state glyph, a name, a detail, and a
274
+ value a row, the columns shared by every row (a subgrid) and ruled by
275
+ hairlines. The glyph wears its state's text tone, which keeps 4.5:1 on
276
+ every ground; the detail and the value are in the code face, the value
277
+ right-aligned in figures of one width. Its words are content, so they
278
+ can be swept and copied. */
279
+ .fact-table {
280
+ display: grid;
281
+ grid-template-columns: var(--icon-md) minmax(8ch, max-content) minmax(0, 1fr) auto;
282
+ column-gap: var(--space-8);
283
+ border-top: var(--line) solid var(--border);
284
+ font: var(--font-size-small) / var(--line-height-compact) var(--font-ui);
285
+ -webkit-user-select: text;
286
+ user-select: text;
287
+ }
288
+
289
+ .fact-row {
290
+ display: grid;
291
+ grid-column: 1 / -1;
292
+ grid-template-columns: subgrid;
293
+ align-items: center;
294
+ padding-block: var(--space-3);
295
+ border-bottom: var(--line) solid var(--border);
296
+ color: var(--text);
297
+ }
298
+
299
+ .fact-state {
300
+ display: inline-flex;
301
+ color: var(--text-dim);
302
+ }
303
+
304
+ .fact-row[data-tone='ready'] > .fact-state {
305
+ color: var(--success-text);
306
+ }
307
+
308
+ .fact-row[data-tone='warning'] > .fact-state {
309
+ color: var(--warning-text);
310
+ }
311
+
312
+ .fact-row[data-tone='danger'] > .fact-state {
313
+ color: var(--danger-text);
314
+ }
315
+
316
+ .fact-name,
317
+ .fact-detail {
318
+ min-width: 0;
319
+ overflow: hidden;
320
+ text-overflow: ellipsis;
321
+ white-space: nowrap;
322
+ }
323
+
324
+ .fact-detail,
325
+ .fact-value {
326
+ font-family: var(--font-mono);
327
+ }
328
+
329
+ .fact-value {
330
+ justify-self: end;
331
+ font-variant-numeric: tabular-nums;
332
+ white-space: nowrap;
333
+ }
@@ -9,6 +9,12 @@ export interface PageTab<Id extends string> {
9
9
  readonly label: string;
10
10
  /** The tab's icon. */
11
11
  readonly icon: LucideIcon;
12
+ /**
13
+ * How many things the page holds or asks about ("Updates 2", "Databases
14
+ * 3"), drawn after the name in the dim tone and read as part of the tab's
15
+ * name; none when absent or null. The app formats it for its language.
16
+ */
17
+ readonly count?: string | number | null;
12
18
  }
13
19
  /** Props for {@link PageTabs}, over the type of its tab ids. */
14
20
  export interface PageTabsProps<Id extends string> {
@@ -212,5 +212,5 @@ export function PageTabs({ label, tabs, current, onSelect, pills = false, look =
212
212
  pageStrip(strip.current, side);
213
213
  }, tabIndex: -1, type: "button", children: _jsx(Icon, { "aria-hidden": true, size: ICON_MD }) }));
214
214
  };
215
- return (_jsxs("div", { className: pills ? 'page-tabs-frame pills' : 'page-tabs-frame', children: [_jsx("div", { "aria-label": label, className: pills ? 'page-tabs pills' : 'page-tabs', onKeyDown: onKeyDown, ref: strip, role: "tablist", children: tabs.map(({ id, label: name, icon: Icon }) => (_jsxs("button", { "aria-label": look === 'icons' ? name : undefined, "aria-selected": id === current, className: "page-tab", "data-page-tab": id, onClick: () => onSelect(id), role: "tab", tabIndex: id === focusable ? 0 : -1, type: "button", ...(look === 'icons' ? tooltip(name) : {}), children: [look !== 'text' && _jsx(Icon, { "aria-hidden": true, size: ICON_MD }), look !== 'icons' && _jsx("span", { "data-label": name, children: name })] }, id))) }), chevron('start'), chevron('end')] }));
215
+ return (_jsxs("div", { className: pills ? 'page-tabs-frame pills' : 'page-tabs-frame', children: [_jsx("div", { "aria-label": label, className: pills ? 'page-tabs pills' : 'page-tabs', onKeyDown: onKeyDown, ref: strip, role: "tablist", children: tabs.map(({ id, label: name, icon: Icon, count = null }) => (_jsxs("button", { "aria-label": look === 'icons' ? (count === null ? name : `${name} ${count}`) : undefined, "aria-selected": id === current, className: "page-tab", "data-page-tab": id, onClick: () => onSelect(id), role: "tab", tabIndex: id === focusable ? 0 : -1, type: "button", ...(look === 'icons' ? tooltip(count === null ? name : `${name} ${count}`) : {}), children: [look !== 'text' && _jsx(Icon, { "aria-hidden": true, size: ICON_MD }), look !== 'icons' && _jsx("span", { "data-label": name, children: name }), look !== 'icons' && count !== null && (_jsx("span", { className: "page-tab-count", "data-label": String(count), children: count }))] }, id))) }), chevron('start'), chevron('end')] }));
216
216
  }
@@ -140,6 +140,20 @@
140
140
  content: attr(data-label) / '';
141
141
  }
142
142
 
143
+ /* A page's count after its name ("Updates 2"): the dim tone in figures of
144
+ one width, so a count that changes moves nothing after it. It keeps the
145
+ width of its bold self too, as the name does. */
146
+ .page-tab > .page-tab-count {
147
+ color: var(--text-dim);
148
+ font-variant-numeric: tabular-nums;
149
+ }
150
+
151
+ /* On the current tab the count takes the current tab's words, which keep
152
+ their contrast on its fill where the dim tone is not held to. */
153
+ .page-tab[aria-selected='true'] > .page-tab-count {
154
+ color: inherit;
155
+ }
156
+
143
157
  .page-tab[aria-selected='true'] {
144
158
  background: var(--current-bg);
145
159
  box-shadow: inset 0 0 0 var(--line) var(--current-ring);
@@ -0,0 +1,30 @@
1
+ import type { ReactElement } from 'react';
2
+ import { type TerminalProps } from './Terminal.js';
3
+ /** The height of a boxed terminal when none is given: a dialog body's console, in pixels. */
4
+ export declare const TERMINAL_BOX_HEIGHT = 200;
5
+ /** Props for {@link TerminalBox}: a `Terminal`'s, less its layout class, and the box's size. */
6
+ export interface TerminalBoxProps extends Omit<TerminalProps, 'className'> {
7
+ /**
8
+ * Fills the room its parent gives it (a dock, a pane's foot) instead of
9
+ * standing as a framed box of `height`: no frame, the parent's whole
10
+ * height. The parent lays it out as a flex column or row.
11
+ */
12
+ readonly fill?: boolean;
13
+ /**
14
+ * The framed box's height in pixels, the same from the first line to the
15
+ * last so the box never grows while output arrives; longer output scrolls
16
+ * inside. `TERMINAL_BOX_HEIGHT` (200) when absent. Ignored with `fill`.
17
+ */
18
+ readonly height?: number;
19
+ }
20
+ /**
21
+ * A terminal in a box of its own: a framed console of a fixed height in a
22
+ * dialog's body (an install's progress), or one that fills its parent (a
23
+ * dock). Every prop but the layout class is the `Terminal`'s, so a box
24
+ * without `onInput` is read-only: output written through the handle draws
25
+ * in place, a progress line redrawn by a carriage return included, and
26
+ * the user selects and copies it. The box pads the terminal to the
27
+ * library's 12px text inset and paints the terminal's ground behind it.
28
+ * Draws `.terminal-box` (`.fill`), with `--terminal-box-height`.
29
+ */
30
+ export declare function TerminalBox({ fill, height, ...terminal }: TerminalBoxProps): ReactElement;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Terminal } from './Terminal.js';
3
+ /** The height of a boxed terminal when none is given: a dialog body's console, in pixels. */
4
+ export const TERMINAL_BOX_HEIGHT = 200;
5
+ /**
6
+ * A terminal in a box of its own: a framed console of a fixed height in a
7
+ * dialog's body (an install's progress), or one that fills its parent (a
8
+ * dock). Every prop but the layout class is the `Terminal`'s, so a box
9
+ * without `onInput` is read-only: output written through the handle draws
10
+ * in place, a progress line redrawn by a carriage return included, and
11
+ * the user selects and copies it. The box pads the terminal to the
12
+ * library's 12px text inset and paints the terminal's ground behind it.
13
+ * Draws `.terminal-box` (`.fill`), with `--terminal-box-height`.
14
+ */
15
+ export function TerminalBox({ fill = false, height = TERMINAL_BOX_HEIGHT, ...terminal }) {
16
+ return (_jsx("div", { className: fill ? 'terminal-box fill' : 'terminal-box', style: fill ? undefined : { '--terminal-box-height': `${height}px` }, children: _jsx(Terminal, { ...terminal, className: "terminal-box-screen" }) }));
17
+ }
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
3
- * canvas, with its Copy and Paste menu and the scrollback length every
3
+ * canvas, with its Copy and Paste menu, `TerminalBox` (a framed console of
4
+ * a fixed height, or one that fills its parent), and the scrollback length every
4
5
  * terminal under `TerminalScrollbackContext` keeps. Imported on its own as
5
6
  * `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
6
7
  * that shows no terminal never loads the engine; its look is terminal.css,
7
8
  * which the base stylesheet imports.
8
9
  */
9
10
  export { Terminal, type TerminalHandle, type TerminalProps, type TerminalSize } from './Terminal.js';
11
+ export { TERMINAL_BOX_HEIGHT, TerminalBox, type TerminalBoxProps } from './TerminalBox.js';
10
12
  export { type TerminalAction, type TerminalKeyStroke } from './Terminal.logic.js';
11
13
  export { DEFAULT_TERMINAL_MENU_CHORDS, type TerminalMenuChords } from './TerminalMenu.logic.js';
12
14
  export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
3
- * canvas, with its Copy and Paste menu and the scrollback length every
3
+ * canvas, with its Copy and Paste menu, `TerminalBox` (a framed console of
4
+ * a fixed height, or one that fills its parent), and the scrollback length every
4
5
  * terminal under `TerminalScrollbackContext` keeps. Imported on its own as
5
6
  * `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
6
7
  * that shows no terminal never loads the engine; its look is terminal.css,
7
8
  * which the base stylesheet imports.
8
9
  */
9
10
  export { Terminal } from './Terminal.js';
11
+ export { TERMINAL_BOX_HEIGHT, TerminalBox } from './TerminalBox.js';
10
12
  export {} from './Terminal.logic.js';
11
13
  export { DEFAULT_TERMINAL_MENU_CHORDS } from './TerminalMenu.logic.js';
12
14
  export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
@@ -193,3 +193,32 @@
193
193
  animation: none;
194
194
  }
195
195
  }
196
+
197
+ /* A terminal in a box of its own (TerminalBox). Framed, it is a console of
198
+ a fixed height (--terminal-box-height, which the component sets) in the
199
+ strong hairline a well wears, on the terminal's ground; filling, it
200
+ takes its parent's room with no frame. Either way it pads the mount by
201
+ the 8px every host adds, so the text starts 12px in. */
202
+ .terminal-box {
203
+ display: flex;
204
+ flex: none;
205
+ min-width: 0;
206
+ height: var(--terminal-box-height);
207
+ padding: var(--space-4);
208
+ overflow: hidden;
209
+ border: var(--line) solid var(--border-strong);
210
+ border-radius: var(--radius-md);
211
+ background: var(--terminal-bg);
212
+ }
213
+
214
+ .terminal-box.fill {
215
+ flex: 1 1 auto;
216
+ min-height: 0;
217
+ height: auto;
218
+ border: none;
219
+ border-radius: 0;
220
+ }
221
+
222
+ .terminal-box > .terminal-box-screen {
223
+ flex: 1;
224
+ }