@wrongstack/tui 0.307.1 → 0.308.1

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Recursively unwrap React Fragments AND Boxes into a flat list of leaf
3
+ * element children.
4
+ *
5
+ * `React.Children.toArray` does NOT flatten Fragments — a Fragment with three
6
+ * `<Text>` children is reported as a single Fragment element. That behavior
7
+ * is fine for most React APIs (which then recurse themselves), but in
8
+ * sidebar cards we want to wrap EACH child in a `│ … │` row. To do that
9
+ * correctly across nested conditional Fragments AND Boxes (which callers
10
+ * use to group their body rows), we need a real flattener that pulls the
11
+ * children out at any depth.
12
+ *
13
+ * Box recursion: a `<Box flexDirection="column">` with several Text rows
14
+ * inside is treated as a group of separate children, not one block. The
15
+ * reason is that the per-row `│ … │` wrapper paints the side bar on the
16
+ * FIRST line of each child element — if the Box is treated as a single
17
+ * child, only its first line gets a right `│` and the rest of the Box
18
+ * overflows past the right edge, visually breaking the frame. Recursing
19
+ * into Boxes costs us the inner Box's flex/width/padding context, but
20
+ * callers use Boxes for "group my rows vertically" semantics, and the
21
+ * per-row `│ … │` wrapper already controls width, padding, and background.
22
+ *
23
+ * Text/primitive nodes are skipped: we only return elements that the
24
+ * caller asked to wrap in `│ … │`.
25
+ */
26
+ import type { ReactElement, ReactNode } from 'react';
27
+ export declare function flattenChildren(node: ReactNode): ReactElement[];
28
+ //# sourceMappingURL=react-children-flatten.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Recursively walk a React element tree and force every <Text> descendant to
3
+ * use `wrap="truncate"`, so the text can never overflow its parent's width
4
+ * and break a wrapping frame (e.g. the per-row `│ … │` chrome of a Card or
5
+ * SidebarPanelCard).
6
+ *
7
+ * Why this exists: Ink lays out a flex child at the size yoga gives it, but
8
+ * a <Text> that doesn't set `wrap="truncate"` will soft-wrap into a multi-
9
+ * line block when the visible content is wider than the parent. That extra
10
+ * height "punches through" our per-row `│` wrapper — the right bar only sits
11
+ * on the first line, so the wrapped overflow lines are bare and the frame
12
+ * looks broken.
13
+ *
14
+ * The clean fix is to ensure EVERY <Text> in the body has `wrap="truncate"`.
15
+ * Rather than asking every call site to remember that, we walk the rendered
16
+ * tree once before it reaches the Card and rewrite the prop. Box children
17
+ * pass through unchanged (their internal layout is the caller's concern, but
18
+ * they usually contain a single Text row anyway).
19
+ */
20
+ import type { ReactNode } from 'react';
21
+ export declare function truncateTextChildren(node: ReactNode): ReactNode;
22
+ //# sourceMappingURL=react-wrap-truncate.d.ts.map
@@ -59,5 +59,13 @@ export declare const SYNTAX_TOKEN: Readonly<Record<SyntaxRole, keyof Theme>>;
59
59
  export declare function resolveSyntaxColor(role: SyntaxRole, palette: Theme): string;
60
60
  export declare function resolveSyntaxPalette(palette: Theme): SyntaxPalette;
61
61
  export declare function softColorWithTheme(color: string | undefined, currentTheme: Theme): string | undefined;
62
+ /**
63
+ * Mix two hex colors in linear-light sRGB. `weight` is the fraction of
64
+ * `colorA` (0..1) — at 0 the result is `colorB`, at 1 it is `colorA`. Used
65
+ * by the sidebar's card tints to derive per-card "raised" surfaces from
66
+ * the theme's accent + surface tokens, so each panel feels color-coded
67
+ * without bloating the theme with extra named tokens.
68
+ */
69
+ export declare function mixHexColors(colorA: string, colorB: string, weight: number): string;
62
70
  export declare function detectSupportsBackground(env?: NodeJS.ProcessEnv, isTTY?: boolean): boolean;
63
71
  //# sourceMappingURL=theme-utils.d.ts.map
package/dist/theme.d.ts CHANGED
@@ -1,8 +1,30 @@
1
1
  import type { SyntaxPalette, SyntaxRole, Theme, ThemeName } from './theme-types.js';
2
- export { catppuccin, detectSupportsBackground, pastel, SYNTAX_TOKEN } from './theme-utils.js';
3
2
  export { baseTheme, THEME_OPTIONS, themePickerOptions, themePresets } from './theme-presets.js';
4
- export type { SyntaxPalette, SyntaxRole, Theme, ThemeName, ThemePickerOption } from './theme-types.js';
3
+ export type { SyntaxPalette, SyntaxRole, Theme, ThemeName, ThemePickerOption, } from './theme-types.js';
4
+ export { catppuccin, detectSupportsBackground, mixHexColors, pastel, SYNTAX_TOKEN, } from './theme-utils.js';
5
5
  export declare const theme: Theme;
6
+ /**
7
+ * "Tinted" surface for the right sidebar's cards. We mix the theme's plain
8
+ * `surface` with its `accent` (and a touch of `surfaceRaised`) so each card
9
+ * reads as a colored "plate" rather than blending into the background.
10
+ * Tuned to roughly 12% accent — enough to be unmistakable, not so much
11
+ * that it competes with the body text.
12
+ *
13
+ * Kept as a top-level constant (not a theme token) so the tint follows the
14
+ * active theme automatically: changing themes retints every card without
15
+ * any extra wiring. The other helpers (cardTopEdge, cardHairline) derive
16
+ * their colors from this same mix so a single source of truth drives the
17
+ * whole "raised surface" treatment.
18
+ */
19
+ export declare const sidebarCardSurface: (current?: Theme) => string;
20
+ /** Bold top edge / leading-rail color for sidebar cards. The accent at
21
+ * full saturation draws the eye down the rail and doubles as a "live
22
+ * state" signal — a green rail = healthy, red = alerting, etc. */
23
+ export declare const sidebarCardEdge: (current?: Theme) => string;
24
+ /** Hairline color used between body rows inside a card. Tinted toward
25
+ * `borderActive` (the "live" border color) so dividers feel alive
26
+ * instead of dead. */
27
+ export declare const sidebarCardHairline: (current?: Theme) => string;
6
28
  export declare function resolveSyntaxColor(role: SyntaxRole, palette?: Theme): string;
7
29
  export declare function resolveSyntaxPalette(palette?: Theme): SyntaxPalette;
8
30
  export declare function softColor(color?: string): string | undefined;
@@ -9,6 +9,23 @@ import type { StatuslineItem as StatuslineItemSource } from './components/status
9
9
  * rendered layout.
10
10
  */
11
11
  export declare const SIDEBAR_MISSION_ROWS = 8;
12
+ /**
13
+ * Minimum inner-content width (cols) at which a routed F-panel sidebar twin
14
+ * renders its `⟦ … ⟧` status pill on the title row's right edge. Below this
15
+ * threshold the pill is bumped to a second status row so the title (and the
16
+ * right-side state) can both fit without truncation. Centralized here so the
17
+ * workspace/task sidebar twins and the SidebarPanelFrame don't drift.
18
+ */
19
+ export declare const PILL_MIN_INNER_WIDTH = 22;
20
+ /**
21
+ * Minimum inner-content width (cols) at which a routed F-panel sidebar twin
22
+ * starts rendering per-row "metric" columns (latency, diff, elapsed, agent
23
+ * count, relative time). Below this threshold the row keeps its identity
24
+ * label only; the secondary metric is dropped to preserve the title.
25
+ * Centralized so the F twins in `sidebar-panels-workspace.tsx` and
26
+ * `sidebar-panels-task.tsx` stop hand-rolling the literal `24`.
27
+ */
28
+ export declare const METRIC_MIN_BODY_WIDTH = 24;
12
29
  /**
13
30
  * Maximum outer height of the /settings picker, including its border. Small
14
31
  * terminals still use their smaller available-height budget; large terminals
@@ -9,6 +9,8 @@ export interface UiGlyphs {
9
9
  info: string;
10
10
  idle: string;
11
11
  running: string;
12
+ /** Paused — a process / phase / mission that is alive but not advancing. */
13
+ pause: string;
12
14
  pending: string;
13
15
  folder: string;
14
16
  workingDirectory: string;
@@ -39,6 +41,100 @@ export interface UiGlyphs {
39
41
  segmentStart: string;
40
42
  segmentTransition: string;
41
43
  segmentEnd: string;
44
+ pillLeft: string;
45
+ pillRight: string;
46
+ pillDot: string;
47
+ railHeavy: string;
48
+ railMid: string;
49
+ railLight: string;
50
+ cornerTL: string;
51
+ cornerTR: string;
52
+ cornerBL: string;
53
+ cornerBR: string;
54
+ edgeT: string;
55
+ edgeB: string;
56
+ dividerDot: string;
57
+ dividerDash: string;
58
+ dividerWave: string;
59
+ dividerDiamond: string;
60
+ meterFull: string;
61
+ meter7: string;
62
+ meter5: string;
63
+ meter3: string;
64
+ meterEmpty: string;
65
+ meterLight: string;
66
+ ladder: string;
67
+ ladderFull: string;
68
+ ladderStep: string;
69
+ arrowRight: string;
70
+ arrowDoubleRight: string;
71
+ arrowUp: string;
72
+ arrowDown: string;
73
+ pulseHigh: string;
74
+ pulseMid: string;
75
+ pulseLow: string;
76
+ diamond: string;
77
+ diamondOpen: string;
78
+ triangleUp: string;
79
+ triangleDown: string;
80
+ triangleRight: string;
81
+ barFull: string;
82
+ barEmpty: string;
83
+ barFade: string;
84
+ blockStack: string;
85
+ block: string;
86
+ spike: string;
87
+ star4: string;
88
+ star8: string;
89
+ ring: string;
90
+ dot: string;
91
+ target: string;
92
+ hash: string;
93
+ at: string;
94
+ link: string;
95
+ lock: string;
96
+ unlock: string;
97
+ bell: string;
98
+ zap: string;
99
+ filter: string;
100
+ search: string;
101
+ tag: string;
102
+ flame: string;
103
+ sparkle: string;
104
+ pin: string;
105
+ bookmark: string;
106
+ flag: string;
107
+ shield: string;
108
+ check: string;
109
+ cross: string;
110
+ bullet: string;
111
+ bulletOpen: string;
112
+ bulletSquare: string;
113
+ bulletHalf: string;
114
+ bulletQuarter: string;
115
+ bulletThreeQuarter: string;
116
+ sparkHi: string;
117
+ sparkMid: string;
118
+ sparkLo: string;
119
+ sparkEmpty: string;
120
+ segmentStartLine: string;
121
+ segmentTransitionLine: string;
122
+ segmentEndLine: string;
123
+ cell0: string;
124
+ cell1: string;
125
+ cell2: string;
126
+ cell3: string;
127
+ cell4: string;
128
+ cell5: string;
129
+ cell6: string;
130
+ cell7: string;
131
+ cell8: string;
132
+ cellFull: string;
133
+ cellEmpty: string;
134
+ indent: string;
135
+ treeLast: string;
136
+ treeBranch: string;
137
+ treeThrough: string;
42
138
  }
43
139
  export declare function resolveIconStyle(env?: NodeJS.ProcessEnv): IconStyle;
44
140
  export declare function glyphSet(style?: IconStyle): UiGlyphs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/tui",
3
- "version": "0.307.1",
3
+ "version": "0.308.1",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack terminal UI: Ink-based interactive renderer with history, pickers, and slash menus.",
6
6
  "repository": {
@@ -29,12 +29,12 @@
29
29
  "ink": "7.1.1",
30
30
  "react": "^19.2.8",
31
31
  "string-width": "8.2.2",
32
- "@wrongstack/core": "0.307.1",
33
- "@wrongstack/runtime": "0.307.1",
34
- "@wrongstack/sdd": "0.307.1",
35
- "@wrongstack/sage": "0.307.1",
36
- "@wrongstack/kanban": "0.307.1",
37
- "@wrongstack/tools": "0.307.1"
32
+ "@wrongstack/core": "0.308.1",
33
+ "@wrongstack/sage": "0.308.1",
34
+ "@wrongstack/kanban": "0.308.1",
35
+ "@wrongstack/runtime": "0.308.1",
36
+ "@wrongstack/sdd": "0.308.1",
37
+ "@wrongstack/tools": "0.308.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@testing-library/dom": "^10.4.1",