diff --git a/README.md b/README.md index 91b4b8f..3e85c6e 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ demo tells you which of those it could not read. | | | |---|---| | **Layout** | rows, columns, grid with spans, `"40%"`, `"2fr"`, `auto`, min/max, padding, gaps, clipping, responsive breakpoints | -| **Widgets** | panel, table, tree, list, log viewer, key/values, meter, gauge, donut, progress, sparkline, line/area/multi-series graph, histogram, heat bar, tabs, status bar, button, checkbox, toggle, radio, select, text input, modal, command palette, tooltip, badge, divider | +| **Widgets** | panel, table, tree, list, log viewer, key/values, meter, gauge, donut, progress, sparkline, line/area/multi-series graph, histogram, heat bar, tabs, status bar, button, checkbox, toggle, radio, select, text input, modal, command palette, tooltip, badge, spinner, divider | | **Graphics** | Braille canvas (2×4 pixels per cell), block/half-block/quadrant/ASCII modes, gradients, software alpha blending | | **Color** | 24-bit truecolor, automatic 256 and 16-colour quantization, `NO_COLOR`, monochrome and high-contrast modes | | **Themes** | dark (default), dracula, nord, tokyo night, gruvbox, matrix, monochrome, high contrast, light — plus `defineTheme()` | diff --git a/apps/benchmark/package.json b/apps/benchmark/package.json index 45c7b34..f8226ce 100644 --- a/apps/benchmark/package.json +++ b/apps/benchmark/package.json @@ -7,6 +7,6 @@ "start": "bun src/main.ts" }, "dependencies": { - "@profullstack/hqtui": "^0.6.0" + "@profullstack/hqtui": "^0.6.1" } } diff --git a/apps/demo/package.json b/apps/demo/package.json index 4f73bc5..2bb17ba 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -1,6 +1,6 @@ { "name": "@profullstack/hqtui-demo", - "version": "0.6.0", + "version": "0.6.1", "description": "The HQTUI reference dashboard: a btop-grade terminal system monitor. Runs on real system metrics or a deterministic simulation.", "license": "MIT", "type": "module", @@ -27,7 +27,7 @@ "audit:scroll": "bun scripts/scrollaudit.ts" }, "dependencies": { - "@profullstack/hqtui": "^0.6.0" + "@profullstack/hqtui": "^0.6.1" }, "publishConfig": { "access": "public" diff --git a/apps/demo/src/main.ts b/apps/demo/src/main.ts index 9f5e2f3..d5b421f 100755 --- a/apps/demo/src/main.ts +++ b/apps/demo/src/main.ts @@ -51,7 +51,7 @@ function parseArgs(argv: string[]): Options { case "-h": case "--help": printHelp(); process.exit(0); case "-v": - case "--version": console.log("hqtui-demo 0.6.0"); process.exit(0); + case "--version": console.log("hqtui-demo 0.6.1"); process.exit(0); } } return options; diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index bf9508f..15e0cdf 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -157,7 +157,7 @@ export default async function Home() { High Quality Terminal UI for TypeScript, Rust, Go, Python, Zig and C++
Terminal dashboards that
diff --git a/apps/web/package.json b/apps/web/package.json
index 818fd02..9f17ccd 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -9,7 +9,7 @@
},
"dependencies": {
"@base-ui/react": "1.7.0",
- "@profullstack/hqtui": "^0.6.0",
+ "@profullstack/hqtui": "^0.6.1",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"lucide-react": "1.37.0",
diff --git a/bun.lock b/bun.lock
index 892e95a..fc7fa6d 100644
--- a/bun.lock
+++ b/bun.lock
@@ -21,7 +21,7 @@
},
"apps/demo": {
"name": "@profullstack/hqtui-demo",
- "version": "0.6.0",
+ "version": "0.6.1",
"bin": {
"hqtui-demo": "./src/main.ts",
},
@@ -63,14 +63,14 @@
},
"packages/hqtui": {
"name": "@profullstack/hqtui",
- "version": "0.6.0",
+ "version": "0.6.1",
"bin": {
"hqtui": "./bin/hqtui.mjs",
},
},
"ports/cobol/adapter": {
"name": "@profullstack/hqtui-cobol-adapter",
- "version": "0.6.0",
+ "version": "0.6.1",
"dependencies": {
"@profullstack/hqtui": "workspace:*",
},
diff --git a/examples/package.json b/examples/package.json
index d1064d1..7bd7deb 100644
--- a/examples/package.json
+++ b/examples/package.json
@@ -4,6 +4,6 @@
"version": "0.1.0",
"type": "module",
"dependencies": {
- "@profullstack/hqtui": "^0.6.0"
+ "@profullstack/hqtui": "^0.6.1"
}
}
diff --git a/packages/hqtui/package.json b/packages/hqtui/package.json
index d4e0ef1..eb20461 100644
--- a/packages/hqtui/package.json
+++ b/packages/hqtui/package.json
@@ -1,6 +1,6 @@
{
"name": "@profullstack/hqtui",
- "version": "0.6.0",
+ "version": "0.6.1",
"description": "High Quality Terminal UI for TypeScript. btop-grade dashboards with a one-import API, dark by default, zero runtime dependencies.",
"license": "MIT",
"type": "module",
diff --git a/packages/hqtui/src/app.ts b/packages/hqtui/src/app.ts
index 2a1d31c..7f08475 100644
--- a/packages/hqtui/src/app.ts
+++ b/packages/hqtui/src/app.ts
@@ -256,6 +256,7 @@ export class App {
elapsed: Date.now() - this.startedAt,
focusIndex: -1,
collapseBorders: this.options.collapseBorders ?? false,
+ reducedMotion: this.options.reducedMotion ?? false,
registerFocus: () => ({ index: -1, focused: false }),
hit: () => {},
overlay: () => {},
@@ -402,6 +403,7 @@ export class App {
elapsed: Date.now() - this.startedAt,
focusIndex: this.focusIndex,
collapseBorders: this.options.collapseBorders ?? false,
+ reducedMotion: this.options.reducedMotion ?? false,
registerFocus: (action?: () => void): FocusRegistration => {
const index = focusCursor++;
if (action) this.focusActions[index] = action;
diff --git a/packages/hqtui/src/cli.ts b/packages/hqtui/src/cli.ts
index bc27ee5..2416929 100644
--- a/packages/hqtui/src/cli.ts
+++ b/packages/hqtui/src/cli.ts
@@ -13,7 +13,7 @@ import { detectCapabilities } from "./capabilities.ts";
import { themeList, themes } from "./theme.ts";
import { BrailleCanvas } from "./graphics/braille.ts";
-const VERSION = "0.6.0";
+const VERSION = "0.6.1";
function help(): void {
console.log(`hqtui ${VERSION} — High Quality Terminal UI for TypeScript
diff --git a/packages/hqtui/src/testing.ts b/packages/hqtui/src/testing.ts
index 06d6e48..54d10a1 100644
--- a/packages/hqtui/src/testing.ts
+++ b/packages/hqtui/src/testing.ts
@@ -18,6 +18,8 @@ export interface RenderOptions {
focus?: number;
/** Merge the borders of adjacent panels, as `createApp` can. */
collapseBorders?: boolean;
+ /** Hold animated widgets still, as `createApp({ reducedMotion: true })` does. */
+ reducedMotion?: boolean;
}
export interface CellSnapshot {
@@ -108,6 +110,7 @@ export function renderToScreen(
elapsed: options.elapsed ?? 0,
focusIndex: options.focus ?? 0,
collapseBorders: options.collapseBorders ?? false,
+ reducedMotion: options.reducedMotion ?? false,
registerFocus: () => {
const index = focusCursor++;
return { index, focused: index === (options.focus ?? 0) };
diff --git a/packages/hqtui/src/ui.ts b/packages/hqtui/src/ui.ts
index d1219c7..85b1b98 100644
--- a/packages/hqtui/src/ui.ts
+++ b/packages/hqtui/src/ui.ts
@@ -98,6 +98,11 @@ export interface RenderContext {
* changes every layout that has two panels side by side.
*/
collapseBorders: boolean;
+ /**
+ * The app was started with `reducedMotion`: widgets that drive their own
+ * redraws (the spinner) draw a still frame and ask for nothing more.
+ */
+ reducedMotion: boolean;
registerFocus(action?: () => void): FocusRegistration;
hit(region: HitRegion): void;
overlay(draw: (root: Surface) => void): void;
@@ -446,8 +451,11 @@ export class Container {
* `active: false` when the work is done and the line settles on a tick.
*/
spinner(options: Omit