@bigpixelrocket/uiok 0.4.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 (68) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/dist/button/TextLink.d.ts +19 -3
  3. package/dist/button/TextLink.js +4 -3
  4. package/dist/dialog/ModalDialog.js +8 -2
  5. package/dist/frame/Tree.d.ts +8 -2
  6. package/dist/frame/Tree.js +5 -3
  7. package/dist/frame/WindowFrame.js +2 -1
  8. package/dist/frame/frame.css +26 -4
  9. package/dist/icon/ProductMark.d.ts +57 -0
  10. package/dist/icon/ProductMark.js +26 -0
  11. package/dist/icon/icon.css +53 -0
  12. package/dist/icon/index.d.ts +3 -1
  13. package/dist/icon/index.js +3 -1
  14. package/dist/labels/settings.d.ts +6 -0
  15. package/dist/labels/settings.js +1 -0
  16. package/dist/listing/Listing.d.ts +60 -4
  17. package/dist/listing/Listing.js +39 -10
  18. package/dist/listing/ListingScope.d.ts +7 -0
  19. package/dist/listing/ListingScope.js +8 -0
  20. package/dist/listing/Timeline.d.ts +51 -0
  21. package/dist/listing/Timeline.js +28 -0
  22. package/dist/listing/index.d.ts +4 -2
  23. package/dist/listing/index.js +3 -1
  24. package/dist/listing/listing.css +185 -22
  25. package/dist/log/Ansi.logic.d.ts +27 -0
  26. package/dist/log/Ansi.logic.js +203 -0
  27. package/dist/log/LogWell.d.ts +11 -2
  28. package/dist/log/LogWell.js +15 -3
  29. package/dist/log/index.d.ts +1 -0
  30. package/dist/log/index.js +1 -0
  31. package/dist/log/log.css +80 -0
  32. package/dist/menu/Menu.d.ts +89 -0
  33. package/dist/menu/Menu.js +143 -0
  34. package/dist/menu/Menu.logic.d.ts +56 -0
  35. package/dist/menu/Menu.logic.js +64 -0
  36. package/dist/menu/index.d.ts +5 -1
  37. package/dist/menu/index.js +5 -1
  38. package/dist/menu/menu.css +51 -0
  39. package/dist/palette/Palette.d.ts +3 -2
  40. package/dist/palette/Palette.js +8 -4
  41. package/dist/palette/PaletteRows.d.ts +129 -0
  42. package/dist/palette/PaletteRows.js +74 -0
  43. package/dist/palette/index.d.ts +5 -2
  44. package/dist/palette/index.js +5 -2
  45. package/dist/pane/PaneFrame.d.ts +22 -1
  46. package/dist/pane/PaneFrame.js +42 -5
  47. package/dist/pane/index.d.ts +1 -1
  48. package/dist/shell/SettingsDialog.d.ts +20 -2
  49. package/dist/shell/SettingsDialog.js +13 -3
  50. package/dist/shell/index.d.ts +1 -1
  51. package/dist/styles.css +1 -0
  52. package/dist/surface/FactTable.d.ts +44 -0
  53. package/dist/surface/FactTable.js +33 -0
  54. package/dist/surface/index.d.ts +4 -2
  55. package/dist/surface/index.js +4 -2
  56. package/dist/surface/surface.css +64 -0
  57. package/dist/tabs/PageTabs.d.ts +6 -0
  58. package/dist/tabs/PageTabs.js +1 -1
  59. package/dist/tabs/tabs.css +14 -0
  60. package/dist/terminal/TerminalBox.d.ts +30 -0
  61. package/dist/terminal/TerminalBox.js +17 -0
  62. package/dist/terminal/index.d.ts +3 -1
  63. package/dist/terminal/index.js +3 -1
  64. package/dist/terminal/terminal.css +29 -0
  65. package/dist/themes/themes.generated.css +20 -0
  66. package/dist/themes/tokens.d.ts +1 -0
  67. package/dist/themes/tokens.js +13 -1
  68. package/package.json +1 -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';
@@ -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
+ }
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
- * lifted panel for one subject's lines; `GroupSwatch`, a group's colour
4
- * beside its name; and `Tag`, a small worded tag in a tone.
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
  */
6
7
  export { Card, type CardProps } from './Card.js';
8
+ export { FactRow, FactTable, type FactRowProps, type FactTableProps, type FactTone } from './FactTable.js';
7
9
  export { Notice, type NoticeProps, type NoticeTone } from './Notice.js';
8
10
  export { GroupSwatch, type GroupSwatchProps } from './GroupSwatch.js';
9
11
  export { Tag, type TagProps, type TagTone } from './Tag.js';
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * Surfaces: `Notice`, an application's status line in a tone; `Card`, a
3
- * lifted panel for one subject's lines; `GroupSwatch`, a group's colour
4
- * beside its name; and `Tag`, a small worded tag in a tone.
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
  */
6
7
  export { Card } from './Card.js';
8
+ export { FactRow, FactTable } from './FactTable.js';
7
9
  export { Notice } from './Notice.js';
8
10
  export { GroupSwatch } from './GroupSwatch.js';
9
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
+ }
@@ -96,6 +96,7 @@
96
96
  --cursor-row-bg: #dae3f4;
97
97
  --row-meta-text: #5c5f77;
98
98
  --glass-edge: rgb(255 255 255 / 60%);
99
+ --product-mark-mix: 100%;
99
100
  --hover-wash: rgb(255 255 255 / 50%);
100
101
  --pressed-wash: rgb(0 0 0 / 7%);
101
102
  --well-shade: rgb(0 0 0 / 7%);
@@ -234,6 +235,7 @@
234
235
  --cursor-row-bg: #2d334b;
235
236
  --row-meta-text: #9399b2;
236
237
  --glass-edge: rgb(255 255 255 / 10%);
238
+ --product-mark-mix: 78%;
237
239
  --hover-wash: rgb(255 255 255 / 6%);
238
240
  --pressed-wash: rgb(205 214 244 / 12%);
239
241
  --well-shade: rgb(0 0 0 / 24%);
@@ -374,6 +376,7 @@
374
376
  --cursor-row-bg: #dae3f4;
375
377
  --row-meta-text: #5c5f77;
376
378
  --glass-edge: rgb(255 255 255 / 60%);
379
+ --product-mark-mix: 100%;
377
380
  --hover-wash: rgb(255 255 255 / 50%);
378
381
  --pressed-wash: rgb(0 0 0 / 7%);
379
382
  --well-shade: rgb(0 0 0 / 7%);
@@ -511,6 +514,7 @@
511
514
  --cursor-row-bg: #e6f0fb;
512
515
  --row-meta-text: #57606a;
513
516
  --glass-edge: rgb(255 255 255 / 60%);
517
+ --product-mark-mix: 100%;
514
518
  --hover-wash: rgb(31 35 40 / 3%);
515
519
  --pressed-wash: rgb(0 0 0 / 8%);
516
520
  --well-shade: rgb(0 0 0 / 7%);
@@ -648,6 +652,7 @@
648
652
  --cursor-row-bg: #e9e5bc;
649
653
  --row-meta-text: #665c54;
650
654
  --glass-edge: rgb(255 255 255 / 60%);
655
+ --product-mark-mix: 100%;
651
656
  --hover-wash: rgb(255 255 255 / 50%);
652
657
  --pressed-wash: rgb(0 0 0 / 7%);
653
658
  --well-shade: rgb(0 0 0 / 7%);
@@ -785,6 +790,7 @@
785
790
  --cursor-row-bg: #e7ebf6;
786
791
  --row-meta-text: #595b66;
787
792
  --glass-edge: rgb(255 255 255 / 60%);
793
+ --product-mark-mix: 100%;
788
794
  --hover-wash: rgb(56 58 66 / 3%);
789
795
  --pressed-wash: rgb(0 0 0 / 8%);
790
796
  --well-shade: rgb(0 0 0 / 7%);
@@ -922,6 +928,7 @@
922
928
  --cursor-row-bg: #e5e6e2;
923
929
  --row-meta-text: #656083;
924
930
  --glass-edge: rgb(255 255 255 / 60%);
931
+ --product-mark-mix: 100%;
925
932
  --hover-wash: rgb(255 255 255 / 58%);
926
933
  --pressed-wash: rgb(0 0 0 / 7%);
927
934
  --well-shade: rgb(0 0 0 / 7%);
@@ -1059,6 +1066,7 @@
1059
1066
  --cursor-row-bg: #e7eadf;
1060
1067
  --row-meta-text: #47626a;
1061
1068
  --glass-edge: rgb(255 255 255 / 60%);
1069
+ --product-mark-mix: 100%;
1062
1070
  --hover-wash: rgb(255 255 255 / 50%);
1063
1071
  --pressed-wash: rgb(0 0 0 / 2%);
1064
1072
  --well-shade: rgb(0 0 0 / 7%);
@@ -1196,6 +1204,7 @@
1196
1204
  --cursor-row-bg: #cfd6e5;
1197
1205
  --row-meta-text: #4d5a8b;
1198
1206
  --glass-edge: rgb(255 255 255 / 60%);
1207
+ --product-mark-mix: 100%;
1199
1208
  --hover-wash: rgb(255 255 255 / 50%);
1200
1209
  --pressed-wash: rgb(0 0 0 / 5%);
1201
1210
  --well-shade: rgb(0 0 0 / 7%);
@@ -1335,6 +1344,7 @@
1335
1344
  --cursor-row-bg: #3d455e;
1336
1345
  --row-meta-text: #a5adce;
1337
1346
  --glass-edge: rgb(255 255 255 / 10%);
1347
+ --product-mark-mix: 78%;
1338
1348
  --hover-wash: rgb(255 255 255 / 6%);
1339
1349
  --pressed-wash: rgb(0 0 0 / 26%);
1340
1350
  --well-shade: rgb(0 0 0 / 24%);
@@ -1473,6 +1483,7 @@
1473
1483
  --cursor-row-bg: #323a54;
1474
1484
  --row-meta-text: #a5adcb;
1475
1485
  --glass-edge: rgb(255 255 255 / 10%);
1486
+ --product-mark-mix: 78%;
1476
1487
  --hover-wash: rgb(255 255 255 / 6%);
1477
1488
  --pressed-wash: rgb(202 211 245 / 13%);
1478
1489
  --well-shade: rgb(0 0 0 / 24%);
@@ -1611,6 +1622,7 @@
1611
1622
  --cursor-row-bg: #2d334b;
1612
1623
  --row-meta-text: #9399b2;
1613
1624
  --glass-edge: rgb(255 255 255 / 10%);
1625
+ --product-mark-mix: 78%;
1614
1626
  --hover-wash: rgb(255 255 255 / 6%);
1615
1627
  --pressed-wash: rgb(205 214 244 / 12%);
1616
1628
  --well-shade: rgb(0 0 0 / 24%);
@@ -1749,6 +1761,7 @@
1749
1761
  --cursor-row-bg: #3d3951;
1750
1762
  --row-meta-text: #bcc2d3;
1751
1763
  --glass-edge: rgb(255 255 255 / 10%);
1764
+ --product-mark-mix: 78%;
1752
1765
  --hover-wash: rgb(255 255 255 / 6%);
1753
1766
  --pressed-wash: rgb(248 248 242 / 11%);
1754
1767
  --well-shade: rgb(0 0 0 / 24%);
@@ -1887,6 +1900,7 @@
1887
1900
  --cursor-row-bg: #101e35;
1888
1901
  --row-meta-text: #8b949e;
1889
1902
  --glass-edge: rgb(255 255 255 / 10%);
1903
+ --product-mark-mix: 78%;
1890
1904
  --hover-wash: rgb(255 255 255 / 6%);
1891
1905
  --pressed-wash: rgb(230 237 243 / 12%);
1892
1906
  --well-shade: rgb(0 0 0 / 24%);
@@ -2025,6 +2039,7 @@
2025
2039
  --cursor-row-bg: #313831;
2026
2040
  --row-meta-text: #bdae93;
2027
2041
  --glass-edge: rgb(255 255 255 / 10%);
2042
+ --product-mark-mix: 78%;
2028
2043
  --hover-wash: rgb(255 255 255 / 6%);
2029
2044
  --pressed-wash: rgb(0 0 0 / 36%);
2030
2045
  --well-shade: rgb(0 0 0 / 24%);
@@ -2163,6 +2178,7 @@
2163
2178
  --cursor-row-bg: #3b4854;
2164
2179
  --row-meta-text: #adb6c6;
2165
2180
  --glass-edge: rgb(255 255 255 / 10%);
2181
+ --product-mark-mix: 78%;
2166
2182
  --hover-wash: rgb(255 255 255 / 6%);
2167
2183
  --pressed-wash: rgb(0 0 0 / 39%);
2168
2184
  --well-shade: rgb(0 0 0 / 24%);
@@ -2301,6 +2317,7 @@
2301
2317
  --cursor-row-bg: #303e4e;
2302
2318
  --row-meta-text: #9da4b2;
2303
2319
  --glass-edge: rgb(255 255 255 / 10%);
2320
+ --product-mark-mix: 78%;
2304
2321
  --hover-wash: rgb(255 255 255 / 6%);
2305
2322
  --pressed-wash: rgb(0 0 0 / 38%);
2306
2323
  --well-shade: rgb(0 0 0 / 24%);
@@ -2439,6 +2456,7 @@
2439
2456
  --cursor-row-bg: #312b3f;
2440
2457
  --row-meta-text: #908caa;
2441
2458
  --glass-edge: rgb(255 255 255 / 10%);
2459
+ --product-mark-mix: 78%;
2442
2460
  --hover-wash: rgb(255 255 255 / 6%);
2443
2461
  --pressed-wash: rgb(224 222 244 / 12%);
2444
2462
  --well-shade: rgb(0 0 0 / 24%);
@@ -2577,6 +2595,7 @@
2577
2595
  --cursor-row-bg: #05384c;
2578
2596
  --row-meta-text: #93a1a1;
2579
2597
  --glass-edge: rgb(255 255 255 / 10%);
2598
+ --product-mark-mix: 78%;
2580
2599
  --hover-wash: rgb(255 255 255 / 6%);
2581
2600
  --pressed-wash: rgb(147 161 161 / 13%);
2582
2601
  --well-shade: rgb(0 0 0 / 24%);
@@ -2715,6 +2734,7 @@
2715
2734
  --cursor-row-bg: #272e43;
2716
2735
  --row-meta-text: #8e96bc;
2717
2736
  --glass-edge: rgb(255 255 255 / 10%);
2737
+ --product-mark-mix: 78%;
2718
2738
  --hover-wash: rgb(255 255 255 / 6%);
2719
2739
  --pressed-wash: rgb(192 202 245 / 13%);
2720
2740
  --well-shade: rgb(0 0 0 / 24%);
@@ -109,6 +109,7 @@ declare function derivedTokens(palette: ThemePalette, terminal: TerminalPalette,
109
109
  '--cursor-row-bg': `#${string}`;
110
110
  '--row-meta-text': `#${string}`;
111
111
  '--glass-edge': string;
112
+ '--product-mark-mix': `${number}%`;
112
113
  '--hover-wash': string;
113
114
  '--pressed-wash': string;
114
115
  '--well-shade': string;
@@ -146,6 +146,7 @@ const BY_APPEARANCE = {
146
146
  hoverWhite: 50,
147
147
  fileListLift: 30,
148
148
  terminalSelection: 22,
149
+ productMarkMix: '100%',
149
150
  pressedBlack: 7,
150
151
  shadow: { raised: 12, popover: 18, modal: 28, modalContact: 12, modalRing: 0 }
151
152
  },
@@ -156,6 +157,7 @@ const BY_APPEARANCE = {
156
157
  hoverWhite: 6,
157
158
  fileListLift: 0,
158
159
  terminalSelection: 28,
160
+ productMarkMix: '78%',
159
161
  pressedBlack: 24,
160
162
  shadow: { raised: 30, popover: 45, modal: 55, modalContact: 35, modalRing: 35 }
161
163
  }
@@ -778,6 +780,9 @@ function derivedTokens(palette, terminal, appearance, overrides, hues) {
778
780
  // HOVER_FROM_REST from rest (white, or the text's tint on a white panel;
779
781
  // see hoverShare); a pressed outlined control darkens instead.
780
782
  '--glass-edge': look.glassEdge,
783
+ // How much of a product's brand colour its mark (ProductMark) shows, the
784
+ // rest the text tone; the brand colour itself is the app's data.
785
+ '--product-mark-mix': look.productMarkMix,
781
786
  '--hover-wash': translucent(hoverTone, hoverShare),
782
787
  // A pressed outlined control: black where it darkens the ground enough
783
788
  // and keeps the text, else the text's tint (see pressedWash).
@@ -1251,7 +1256,14 @@ const BASE_TOKEN_NAMES = [
1251
1256
  '--tree-indent',
1252
1257
  '--log-source',
1253
1258
  '--log-source-width',
1254
- '--text-gutter-width'
1259
+ '--text-gutter-width',
1260
+ '--terminal-box-height',
1261
+ '--product-mark-colour',
1262
+ '--product-mark-fill',
1263
+ '--product-mark-stroke',
1264
+ '--timeline-start',
1265
+ '--timeline-end',
1266
+ '--timeline-at'
1255
1267
  ];
1256
1268
  /** Every token name uiok defines: the fixed tokens, those a theme sets, and the stylesheet's own. */
1257
1269
  const UIOK_TOKEN_NAMES = new Set([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigpixelrocket/uiok",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "A React UI library with a retro look: themeable design tokens and accessible components.",
5
5
  "keywords": [
6
6
  "react",