@gaia-ai/addon-gaia-ui 0.16.0 → 0.16.2

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 (220) hide show
  1. package/dist/src/Component/badge/index.d.ts +11 -0
  2. package/dist/src/Component/badge/index.js +10 -0
  3. package/dist/src/Component/bar-chart/index.d.ts +16 -0
  4. package/dist/src/Component/bar-chart/index.js +63 -0
  5. package/dist/src/Component/card/index.d.ts +16 -0
  6. package/dist/src/Component/card/index.js +39 -0
  7. package/dist/src/Component/divider/index.d.ts +7 -0
  8. package/dist/src/Component/divider/index.js +13 -0
  9. package/dist/src/Component/heat-map/index.d.ts +21 -0
  10. package/dist/src/Component/heat-map/index.js +86 -0
  11. package/dist/src/Component/key-value/index.d.ts +18 -0
  12. package/dist/src/Component/key-value/index.js +30 -0
  13. package/dist/src/Component/markdown/index.d.ts +35 -5
  14. package/dist/src/Component/markdown/index.js +72 -16
  15. package/dist/src/Entity/team/Data/workload.d.ts +3 -1
  16. package/dist/src/Entity/team/Data/workload.js +6 -4
  17. package/dist/src/Entity/team/Screen/team-work.d.ts +12 -1
  18. package/dist/src/Entity/team/Screen/team-work.js +47 -2
  19. package/dist/src/Entity/ticket/Component/demo-statistics.d.ts +14 -0
  20. package/dist/src/Entity/ticket/Component/demo-statistics.js +88 -0
  21. package/dist/src/Entity/ticket/Component/react-statistics.d.ts +14 -22
  22. package/dist/src/Entity/ticket/Component/react-statistics.js +21 -42
  23. package/dist/src/Entity/ticket/Component/ticket-content/index.d.ts +28 -3
  24. package/dist/src/Entity/ticket/Component/ticket-content/index.js +331 -157
  25. package/dist/src/Entity/ticket/Data/parents.js +1 -1
  26. package/dist/src/Entity/ticket/Data/query.d.ts +2 -2
  27. package/dist/src/Entity/ticket/Data/query.js +13 -9
  28. package/dist/src/Entity/ticket/Data/store.js +1 -1
  29. package/dist/src/Entity/ticket/Data/tickets.d.ts +1 -1
  30. package/dist/src/Entity/ticket/Data/tickets.js +1 -1
  31. package/dist/src/Entity/ticket/Form/edit.d.ts +13 -0
  32. package/dist/src/Entity/ticket/Form/edit.js +17 -7
  33. package/dist/src/Entity/ticket/Screen/conductor-tickets.d.ts +7 -1
  34. package/dist/src/Entity/ticket/Screen/conductor-tickets.js +30 -6
  35. package/dist/src/Entity/ticket/Screen/edit-assignment-form.d.ts +3 -1
  36. package/dist/src/Entity/ticket/Screen/edit-assignment-form.js +21 -6
  37. package/dist/src/Entity/ticket/Screen/my-work.d.ts +8 -1
  38. package/dist/src/Entity/ticket/Screen/my-work.js +37 -4
  39. package/dist/src/Entity/ticket/Screen/ticket-comments.d.ts +6 -12
  40. package/dist/src/Entity/ticket/Screen/ticket-comments.js +11 -16
  41. package/dist/src/Entity/ticket/Screen/ticket-content-screen.d.ts +25 -44
  42. package/dist/src/Entity/ticket/Screen/ticket-content-screen.js +79 -87
  43. package/dist/src/Entity/ticket/Screen/ticket-detail.d.ts +6 -11
  44. package/dist/src/Entity/ticket/Screen/ticket-detail.js +14 -19
  45. package/dist/src/Entity/ticket/Screen/ticket-filter-bar.js +2 -9
  46. package/dist/src/Entity/ticket/Screen/ticket-planning.d.ts +6 -12
  47. package/dist/src/Entity/ticket/Screen/ticket-planning.js +11 -16
  48. package/dist/src/Entity/ticket/Screen/ticket-react-markdown.d.ts +9 -7
  49. package/dist/src/Entity/ticket/Screen/ticket-react-markdown.js +36 -13
  50. package/dist/src/Entity/ticket/Screen/ticket-react.d.ts +21 -8
  51. package/dist/src/Entity/ticket/Screen/ticket-react.js +109 -34
  52. package/dist/src/Entity/ticket/Screen/ticket-search.d.ts +44 -0
  53. package/dist/src/Entity/ticket/Screen/ticket-search.js +97 -0
  54. package/dist/src/Entity/ticket/Screen/tickets.d.ts +9 -7
  55. package/dist/src/Entity/ticket/Screen/tickets.js +25 -85
  56. package/dist/src/Entity/ticket/Screen/user-tickets.d.ts +7 -0
  57. package/dist/src/Entity/ticket/Screen/user-tickets.js +30 -2
  58. package/dist/src/Kernel/renderer.d.ts +1 -3
  59. package/dist/src/Kernel/renderer.js +2 -5
  60. package/dist/src/Kernel/tui-kernel.js +7 -16
  61. package/dist/src/Screen/async-screen.d.ts +13 -0
  62. package/dist/src/Screen/async-screen.js +34 -5
  63. package/dist/src/Screen/list-screen.d.ts +11 -2
  64. package/dist/src/Screen/list-screen.js +20 -2
  65. package/dist/src/Screen/screen.d.ts +6 -2
  66. package/dist/src/Statistics/comparison-chart.d.ts +4 -2
  67. package/dist/src/Statistics/comparison-chart.js +14 -6
  68. package/dist/src/Statistics/figures.d.ts +17 -3
  69. package/dist/src/Statistics/figures.js +104 -41
  70. package/dist/src/Statistics/presentation.d.ts +3 -5
  71. package/dist/src/Statistics/presentation.js +3 -5
  72. package/dist/src/Statistics/screen.d.ts +16 -5
  73. package/dist/src/Statistics/screen.js +59 -26
  74. package/dist/src/lib/theme.d.ts +0 -56
  75. package/dist/src/lib/theme.js +0 -42
  76. package/dist/src/lib/vnode.d.ts +29 -0
  77. package/dist/src/lib/vnode.js +69 -0
  78. package/dist/src/route.js +37 -0
  79. package/dist/src/types.d.ts +5 -1
  80. package/dist/src/ui.d.ts +0 -1
  81. package/dist/src/ui.js +0 -1
  82. package/package.json +2 -2
  83. package/dist/src/Agent/Component/agent-list/index.d.ts +0 -6
  84. package/dist/src/Agent/Component/agent-list/index.js +0 -14
  85. package/dist/src/Component/agent-list/index.d.ts +0 -6
  86. package/dist/src/Component/agent-list/index.js +0 -14
  87. package/dist/src/Component/comment-item/index.d.ts +0 -21
  88. package/dist/src/Component/comment-item/index.js +0 -39
  89. package/dist/src/Component/create-form/index.d.ts +0 -3
  90. package/dist/src/Component/create-form/index.js +0 -26
  91. package/dist/src/Component/dashboard-list/index.d.ts +0 -8
  92. package/dist/src/Component/dashboard-list/index.js +0 -7
  93. package/dist/src/Component/project-picker/index.d.ts +0 -15
  94. package/dist/src/Component/project-picker/index.js +0 -42
  95. package/dist/src/Component/run-table/index.d.ts +0 -10
  96. package/dist/src/Component/run-table/index.js +0 -20
  97. package/dist/src/Component/tab-bar/index.d.ts +0 -20
  98. package/dist/src/Component/tab-bar/index.js +0 -42
  99. package/dist/src/Component/ticket-detail/index.d.ts +0 -38
  100. package/dist/src/Component/ticket-detail/index.js +0 -193
  101. package/dist/src/Component/ticket-table/index.d.ts +0 -5
  102. package/dist/src/Component/ticket-table/index.js +0 -14
  103. package/dist/src/Component/ticket-teaser/index.d.ts +0 -7
  104. package/dist/src/Component/ticket-teaser/index.js +0 -76
  105. package/dist/src/Deriver/liveness.d.ts +0 -12
  106. package/dist/src/Deriver/liveness.js +0 -34
  107. package/dist/src/Deriver/run-status.d.ts +0 -12
  108. package/dist/src/Deriver/run-status.js +0 -36
  109. package/dist/src/Entity/conductor/Component/conductor-list/index.d.ts +0 -25
  110. package/dist/src/Entity/conductor/Component/conductor-list/index.js +0 -60
  111. package/dist/src/Entity/project/Component/dashboard-list/index.d.ts +0 -8
  112. package/dist/src/Entity/project/Component/dashboard-list/index.js +0 -7
  113. package/dist/src/Entity/project/Component/project-list/index.d.ts +0 -8
  114. package/dist/src/Entity/project/Component/project-list/index.js +0 -7
  115. package/dist/src/Entity/project/Component/project-picker/index.d.ts +0 -15
  116. package/dist/src/Entity/project/Component/project-picker/index.js +0 -42
  117. package/dist/src/Entity/project/Screen/project-work.d.ts +0 -33
  118. package/dist/src/Entity/project/Screen/project-work.js +0 -114
  119. package/dist/src/Entity/run/Component/run-table/index.d.ts +0 -8
  120. package/dist/src/Entity/run/Component/run-table/index.js +0 -11
  121. package/dist/src/Entity/statistics/Data/statistics.d.ts +0 -147
  122. package/dist/src/Entity/statistics/Data/statistics.js +0 -235
  123. package/dist/src/Entity/statistics/Screen/dashboard.d.ts +0 -70
  124. package/dist/src/Entity/statistics/Screen/dashboard.js +0 -216
  125. package/dist/src/Entity/statistics/render.d.ts +0 -6
  126. package/dist/src/Entity/statistics/render.js +0 -71
  127. package/dist/src/Entity/ticket/Component/tab-bar/index.d.ts +0 -20
  128. package/dist/src/Entity/ticket/Component/tab-bar/index.js +0 -71
  129. package/dist/src/Entity/ticket/Component/ticket-table/index.d.ts +0 -7
  130. package/dist/src/Entity/ticket/Component/ticket-table/index.js +0 -10
  131. package/dist/src/Entity/user/Screen/user-overview.d.ts +0 -33
  132. package/dist/src/Entity/user/Screen/user-overview.js +0 -80
  133. package/dist/src/Extension/contract.d.ts +0 -204
  134. package/dist/src/Extension/contract.js +0 -1
  135. package/dist/src/Kernel/react-body.d.ts +0 -9
  136. package/dist/src/Kernel/react-body.js +0 -42
  137. package/dist/src/Screen/async-react-screen.d.ts +0 -45
  138. package/dist/src/Screen/async-react-screen.js +0 -120
  139. package/dist/src/Screen/dashboard.d.ts +0 -1
  140. package/dist/src/Screen/dashboard.js +0 -1
  141. package/dist/src/Screen/project.d.ts +0 -1
  142. package/dist/src/Screen/project.js +0 -1
  143. package/dist/src/Screen/projects.d.ts +0 -1
  144. package/dist/src/Screen/projects.js +0 -1
  145. package/dist/src/Screen/react-screen.d.ts +0 -14
  146. package/dist/src/Screen/react-screen.js +0 -34
  147. package/dist/src/Screen/ticket.d.ts +0 -1
  148. package/dist/src/Screen/ticket.js +0 -1
  149. package/dist/src/Service/agent.d.ts +0 -17
  150. package/dist/src/Service/agent.js +0 -28
  151. package/dist/src/Service/create-form-data.d.ts +0 -10
  152. package/dist/src/Service/create-form-data.js +0 -52
  153. package/dist/src/Service/create-form.d.ts +0 -52
  154. package/dist/src/Service/create-form.js +0 -98
  155. package/dist/src/Service/project-data.d.ts +0 -48
  156. package/dist/src/Service/project-data.js +0 -92
  157. package/dist/src/Service/projects.d.ts +0 -21
  158. package/dist/src/Service/projects.js +0 -80
  159. package/dist/src/Service/route.d.ts +0 -11
  160. package/dist/src/Service/route.js +0 -215
  161. package/dist/src/Service/run-data.d.ts +0 -35
  162. package/dist/src/Service/run-data.js +0 -62
  163. package/dist/src/Service/ticket-data.d.ts +0 -6
  164. package/dist/src/Service/ticket-data.js +0 -7
  165. package/dist/src/Tui/controller.d.ts +0 -13
  166. package/dist/src/Tui/controller.js +0 -1794
  167. package/dist/src/Vendor/termcn/hooks/use-motion.d.ts +0 -5
  168. package/dist/src/Vendor/termcn/hooks/use-motion.js +0 -7
  169. package/dist/src/Vendor/termcn/hooks/use-theme.d.ts +0 -5
  170. package/dist/src/Vendor/termcn/hooks/use-theme.js +0 -10
  171. package/dist/src/Vendor/termcn/hooks/use-unicode.d.ts +0 -5
  172. package/dist/src/Vendor/termcn/hooks/use-unicode.js +0 -34
  173. package/dist/src/Vendor/termcn/lib/dither-chart-utils.d.ts +0 -130
  174. package/dist/src/Vendor/termcn/lib/dither-chart-utils.js +0 -357
  175. package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.d.ts +0 -2
  176. package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.js +0 -72
  177. package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.d.ts +0 -2
  178. package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.js +0 -113
  179. package/dist/src/Vendor/termcn/themes/default.d.ts +0 -1
  180. package/dist/src/Vendor/termcn/themes/default.js +0 -3
  181. package/dist/src/Vendor/termcn/ui/badge.d.ts +0 -13
  182. package/dist/src/Vendor/termcn/ui/badge.js +0 -33
  183. package/dist/src/Vendor/termcn/ui/bar-chart.d.ts +0 -16
  184. package/dist/src/Vendor/termcn/ui/bar-chart.js +0 -61
  185. package/dist/src/Vendor/termcn/ui/card.d.ts +0 -18
  186. package/dist/src/Vendor/termcn/ui/card.js +0 -7
  187. package/dist/src/Vendor/termcn/ui/dither-chart.d.ts +0 -118
  188. package/dist/src/Vendor/termcn/ui/dither-chart.js +0 -418
  189. package/dist/src/Vendor/termcn/ui/dither-line-chart.d.ts +0 -10
  190. package/dist/src/Vendor/termcn/ui/dither-line-chart.js +0 -11
  191. package/dist/src/Vendor/termcn/ui/dither-radar-chart.d.ts +0 -21
  192. package/dist/src/Vendor/termcn/ui/dither-radar-chart.js +0 -11
  193. package/dist/src/Vendor/termcn/ui/divider.d.ts +0 -14
  194. package/dist/src/Vendor/termcn/ui/divider.js +0 -25
  195. package/dist/src/Vendor/termcn/ui/gauge.d.ts +0 -12
  196. package/dist/src/Vendor/termcn/ui/gauge.js +0 -48
  197. package/dist/src/Vendor/termcn/ui/heat-map.d.ts +0 -13
  198. package/dist/src/Vendor/termcn/ui/heat-map.js +0 -59
  199. package/dist/src/Vendor/termcn/ui/key-value.d.ts +0 -16
  200. package/dist/src/Vendor/termcn/ui/key-value.js +0 -24
  201. package/dist/src/Vendor/termcn/ui/line-chart.d.ts +0 -15
  202. package/dist/src/Vendor/termcn/ui/line-chart.js +0 -102
  203. package/dist/src/Vendor/termcn/ui/markdown.d.ts +0 -24
  204. package/dist/src/Vendor/termcn/ui/markdown.js +0 -39
  205. package/dist/src/Vendor/termcn/ui/progress-bar.d.ts +0 -13
  206. package/dist/src/Vendor/termcn/ui/progress-bar.js +0 -13
  207. package/dist/src/Vendor/termcn/ui/sparkline.d.ts +0 -8
  208. package/dist/src/Vendor/termcn/ui/sparkline.js +0 -30
  209. package/dist/src/Vendor/termcn/ui/types.d.ts +0 -82
  210. package/dist/src/Vendor/termcn/ui/types.js +0 -1
  211. package/dist/src/lib/ansi.d.ts +0 -34
  212. package/dist/src/lib/ansi.js +0 -97
  213. package/dist/src/lib/hit-test.d.ts +0 -138
  214. package/dist/src/lib/hit-test.js +0 -138
  215. package/dist/src/lib/mouse.d.ts +0 -35
  216. package/dist/src/lib/mouse.js +0 -89
  217. package/dist/src/lib/table.d.ts +0 -37
  218. package/dist/src/lib/table.js +0 -20
  219. package/dist/src/lib/ticket-query.d.ts +0 -21
  220. package/dist/src/lib/ticket-query.js +0 -72
@@ -0,0 +1,14 @@
1
+ import type { StatisticFigureGroup } from '../../../Statistics/client.js';
2
+ /**
3
+ * Local example data for the optional Statistics demo tab.
4
+ *
5
+ * Shaped as the server's configured-figure contract, so the demo paints through
6
+ * the same `StatisticsFigures` composition the production Stats screens use
7
+ * rather than through a separate set of demo-only widgets. No value here is
8
+ * read from or written to a control plane.
9
+ */
10
+ export interface StatisticExample {
11
+ readonly name: string;
12
+ readonly groups: readonly StatisticFigureGroup[];
13
+ }
14
+ export declare const STATISTIC_EXAMPLES: readonly StatisticExample[];
@@ -0,0 +1,88 @@
1
+ const DAYS = [
2
+ '2026-09-21',
3
+ '2026-09-22',
4
+ '2026-09-23',
5
+ '2026-09-24',
6
+ '2026-09-25',
7
+ '2026-09-26',
8
+ '2026-09-27',
9
+ ];
10
+ const WEEKDAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
11
+ const STATES = ['Ready', 'Coding', 'Review', 'Done'];
12
+ const figure = (id, label, widget, categories, measurements) => {
13
+ const empty = measurements.every((measurement) => Object.values(measurement.values).every((value) => value === null));
14
+ return {
15
+ id,
16
+ label,
17
+ description: '',
18
+ widget,
19
+ generated: '2026-09-27T00:00:00Z',
20
+ filters: {},
21
+ categories,
22
+ measurements: measurements.map((measurement) => ({
23
+ value_type: 'integer',
24
+ unit: 'count',
25
+ ...measurement,
26
+ })),
27
+ empty: {
28
+ is_empty: empty,
29
+ message: empty ? 'No example values for this scenario.' : null,
30
+ },
31
+ cache: { max_age: 0, contexts: [], tags: [] },
32
+ };
33
+ };
34
+ const example = (name, states, trend) => {
35
+ const value = (values, index) => values[index] ?? null;
36
+ return {
37
+ name,
38
+ groups: [
39
+ {
40
+ id: 'demo',
41
+ label: 'Example statistics',
42
+ figures: [
43
+ figure('demo-states', 'Tickets by state', 'matrix', STATES.map((state, index) => ({
44
+ key: `state-${index}`,
45
+ label: state,
46
+ })), [
47
+ {
48
+ id: 'tickets',
49
+ label: 'Tickets',
50
+ values: Object.fromEntries(STATES.map((_, index) => [
51
+ `state-${index}`,
52
+ value(states, index),
53
+ ])),
54
+ },
55
+ ]),
56
+ figure('demo-share', 'Share by state', 'grouped_horizontal_bars', STATES.map((state, index) => ({
57
+ key: `share-${index}`,
58
+ label: state,
59
+ })), [
60
+ {
61
+ id: 'share',
62
+ label: 'Tickets',
63
+ values: Object.fromEntries(STATES.map((_, index) => [
64
+ `share-${index}`,
65
+ value(states, index),
66
+ ])),
67
+ },
68
+ ]),
69
+ figure('demo-completed', 'Completed per day', 'line', DAYS.map((day, index) => ({
70
+ key: day,
71
+ label: WEEKDAYS[index] ?? day,
72
+ })), [
73
+ {
74
+ id: 'completed',
75
+ label: 'Completed',
76
+ values: Object.fromEntries(DAYS.map((day, index) => [day, value(trend, index)])),
77
+ },
78
+ ]),
79
+ ],
80
+ },
81
+ ],
82
+ };
83
+ };
84
+ export const STATISTIC_EXAMPLES = [
85
+ example('Steady week', [12, 7, 4, 26], [3, 5, 4, 8, 6, 9, 11]),
86
+ example('Busy week', [5, 14, 8, 42], [5, 8, 6, 13, 9, 15, 18]),
87
+ example('Empty project', [], []),
88
+ ];
@@ -1,22 +1,14 @@
1
- export declare const STATISTIC_EXAMPLES: readonly [{
2
- readonly name: "Steady week";
3
- readonly states: readonly [12, 7, 4, 26];
4
- readonly trend: readonly [3, 5, 4, 8, 6, 9, 11];
5
- readonly progress: 65;
6
- readonly budget: 42;
7
- }, {
8
- readonly name: "Busy week";
9
- readonly states: readonly [5, 14, 8, 42];
10
- readonly trend: readonly [5, 8, 6, 13, 9, 15, 18];
11
- readonly progress: 90;
12
- readonly budget: 78;
13
- }, {
14
- readonly name: "Empty project";
15
- readonly states: readonly [];
16
- readonly trend: readonly [];
17
- readonly progress: 0;
18
- readonly budget: 0;
19
- }];
20
- export declare function ReactStatistics({ scenario }: {
21
- scenario: number;
22
- }): import("react").ReactNode;
1
+ import { type VNode } from '@opentui/core';
2
+ export { STATISTIC_EXAMPLES } from './demo-statistics.js';
3
+ export interface DemoStatisticsProps {
4
+ readonly id: string;
5
+ readonly scenario: number;
6
+ /** The figure grid's last measured width, and where a new one is reported. */
7
+ readonly width: number;
8
+ readonly onResize: (width: number) => void;
9
+ }
10
+ /**
11
+ * The demo's chart area: a labelled local scenario painted through the same
12
+ * `StatisticsFigures` the production Stats screens use.
13
+ */
14
+ export declare function DemoStatistics({ id, scenario, width, onResize, }: DemoStatisticsProps): VNode;
@@ -1,44 +1,23 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
- import { useTerminalDimensions } from '@opentui/react';
3
- import { Badge } from '../../../Vendor/termcn/ui/badge.js';
4
- import { BarChart } from '../../../Vendor/termcn/ui/bar-chart.js';
5
- import { Card } from '../../../Vendor/termcn/ui/card.js';
6
- import { Gauge } from '../../../Vendor/termcn/ui/gauge.js';
7
- import { LineChart } from '../../../Vendor/termcn/ui/line-chart.js';
8
- import { ProgressBar } from '../../../Vendor/termcn/ui/progress-bar.js';
9
- import { Sparkline } from '../../../Vendor/termcn/ui/sparkline.js';
10
- export const STATISTIC_EXAMPLES = [
11
- {
12
- name: 'Steady week',
13
- states: [12, 7, 4, 26],
14
- trend: [3, 5, 4, 8, 6, 9, 11],
15
- progress: 65,
16
- budget: 42,
17
- },
18
- {
19
- name: 'Busy week',
20
- states: [5, 14, 8, 42],
21
- trend: [5, 8, 6, 13, 9, 15, 18],
22
- progress: 90,
23
- budget: 78,
24
- },
25
- { name: 'Empty project', states: [], trend: [], progress: 0, budget: 0 },
26
- ];
27
- const DAYS = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
28
- const LABELS = ['Ready', 'Coding', 'Review', 'Done'];
29
- const COLORS = ['#60a5fa', '#a78bfa', '#fbbf24', '#34d399'];
30
- export function ReactStatistics({ scenario }) {
31
- const { width } = useTerminalDimensions();
1
+ import { BoxRenderable, h } from '@opentui/core';
2
+ import { Badge } from '../../../Component/badge/index.js';
3
+ import { FOREGROUND, paragraphNode, plainRun } from '../../../lib/vnode.js';
4
+ import { StatisticsFigures } from '../../../Statistics/figures.js';
5
+ import { STATISTIC_EXAMPLES } from './demo-statistics.js';
6
+ export { STATISTIC_EXAMPLES } from './demo-statistics.js';
7
+ /**
8
+ * The demo's chart area: a labelled local scenario painted through the same
9
+ * `StatisticsFigures` the production Stats screens use.
10
+ */
11
+ export function DemoStatistics({ id, scenario, width, onResize, }) {
32
12
  const example = STATISTIC_EXAMPLES[scenario] ?? STATISTIC_EXAMPLES[0];
33
- const wide = width >= 100;
34
- const panelWidth = Math.max(24, Math.min(70, Math.floor((width - 12) / (wide ? 2 : 1))));
35
- const chartWidth = Math.max(18, panelWidth - 6);
36
- return (_jsxs("box", { flexDirection: "column", gap: 1, children: [_jsxs("box", { flexDirection: "row", gap: 2, children: [_jsx(Badge, { variant: "info", bordered: false, children: "Example data" }), _jsxs("text", { children: [example.name, " \u00B7 n: next scenario"] })] }), _jsxs("box", { flexDirection: wide ? 'row' : 'column', gap: 1, children: [_jsx(Card, { title: "Tickets by state", width: panelWidth, children: _jsx(BarChart, { data: example.states.map((value, index) => ({
37
- label: LABELS[index] ?? '',
38
- value,
39
- color: COLORS[index] ?? '#60a5fa',
40
- })), width: chartWidth }) }), _jsx(Card, { title: "Completed per day", subtitle: "Last 7 days \u00B7 example counts", width: panelWidth, children: _jsx(LineChart, { data: example.trend.map((value, index) => ({
41
- value,
42
- label: DAYS[index] ?? '',
43
- })), width: chartWidth, height: 6, color: "#34d399" }) })] }), _jsxs("box", { flexDirection: wide ? 'row' : 'column', gap: 1, children: [_jsxs(Card, { title: "Sprint progress", width: panelWidth, children: [_jsx(ProgressBar, { value: example.progress, width: Math.max(8, chartWidth - 6), color: "#60a5fa" }), _jsx(Sparkline, { data: [...example.trend], width: Math.max(8, chartWidth - 10), label: "Activity", color: "#34d399" })] }), _jsx(Card, { title: "Budget used", width: panelWidth, children: _jsx(Gauge, { value: example.budget, size: "md", color: "#fbbf24" }) })] })] }));
13
+ return h(BoxRenderable, { id, flexDirection: 'column', gap: 1 }, h(BoxRenderable, { id: `${id}-label`, flexDirection: 'row', gap: 2 }, Badge({ id: `${id}-badge`, label: 'Example data', variant: 'info' }), paragraphNode({
14
+ id: `${id}-scenario`,
15
+ runs: [plainRun(`${example?.name ?? ''} · n: next scenario`)],
16
+ fg: FOREGROUND,
17
+ })), StatisticsFigures({
18
+ id: `${id}-grid`,
19
+ groups: example?.groups ?? [],
20
+ width,
21
+ onResize,
22
+ }));
44
23
  }
@@ -1,6 +1,21 @@
1
- import { type ReactNode } from 'react';
2
- import { type TicketContentModel, type TicketContentTab, type TicketProperty } from './model.js';
1
+ import { type VNode } from '@opentui/core';
2
+ import { type TicketContentEntry, type TicketContentModel, type TicketContentTab, type TicketProperty, type TicketSidebar } from './model.js';
3
+ export declare const SIDEBAR_TABS: readonly [{
4
+ readonly id: "details";
5
+ readonly label: "Details";
6
+ }, {
7
+ readonly id: "stats";
8
+ readonly label: "Stats";
9
+ }, {
10
+ readonly id: "related";
11
+ readonly label: "Related";
12
+ }];
13
+ export type SidebarTabId = (typeof SIDEBAR_TABS)[number]['id'];
14
+ /** The pane a sidebar opens on: Stats once the ticket is done, else Details. */
15
+ export declare const defaultSidebarTab: (sidebar: TicketSidebar) => SidebarTabId;
3
16
  export interface TicketContentProps {
17
+ /** The owner every node id derives from. */
18
+ readonly id: string;
4
19
  readonly model: TicketContentModel;
5
20
  readonly tab: TicketContentTab;
6
21
  readonly selectedKey?: string;
@@ -8,5 +23,15 @@ export interface TicketContentProps {
8
23
  readonly select: (key: string) => void;
9
24
  readonly toggle: (key: string) => void;
10
25
  readonly activateProperty?: (item: TicketProperty) => void;
26
+ /** Terminal width — the Overview's side-by-side breakpoint reads it. */
27
+ readonly terminalColumns: number;
28
+ /** The visit's sidebar pane; absent means {@link defaultSidebarTab}. */
29
+ readonly sidebarTab?: SidebarTabId;
30
+ readonly onSidebarTab: (tab: SidebarTabId) => void;
31
+ /** The Planning document tab last chosen in this visit. */
32
+ readonly documentKey?: string;
33
+ readonly onDocumentTab: (key: string) => void;
11
34
  }
12
- export declare function TicketContent({ model, tab, selectedKey, expandedKeys, select, toggle, activateProperty, }: TicketContentProps): ReactNode;
35
+ /** The Planning pane's active document: the selection, the visit's tab, or Description. */
36
+ export declare const activeDocumentKey: (documents: readonly TicketContentEntry[], selectedKey: string | undefined, documentKey: string | undefined) => string | undefined;
37
+ export declare function TicketContent(props: TicketContentProps): VNode;