@gaia-ai/addon-gaia-ui 0.15.2 → 0.16.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.
Files changed (192) 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/ticket/Component/demo-statistics.d.ts +14 -0
  16. package/dist/src/Entity/ticket/Component/demo-statistics.js +88 -0
  17. package/dist/src/Entity/ticket/Component/react-statistics.d.ts +14 -22
  18. package/dist/src/Entity/ticket/Component/react-statistics.js +21 -42
  19. package/dist/src/Entity/ticket/Component/ticket-content/index.d.ts +28 -3
  20. package/dist/src/Entity/ticket/Component/ticket-content/index.js +331 -157
  21. package/dist/src/Entity/ticket/Data/store.js +1 -1
  22. package/dist/src/Entity/ticket/Screen/ticket-comments.d.ts +6 -12
  23. package/dist/src/Entity/ticket/Screen/ticket-comments.js +11 -16
  24. package/dist/src/Entity/ticket/Screen/ticket-content-screen.d.ts +25 -44
  25. package/dist/src/Entity/ticket/Screen/ticket-content-screen.js +79 -87
  26. package/dist/src/Entity/ticket/Screen/ticket-detail.d.ts +6 -11
  27. package/dist/src/Entity/ticket/Screen/ticket-detail.js +14 -19
  28. package/dist/src/Entity/ticket/Screen/ticket-planning.d.ts +6 -12
  29. package/dist/src/Entity/ticket/Screen/ticket-planning.js +11 -16
  30. package/dist/src/Entity/ticket/Screen/ticket-react-markdown.d.ts +9 -7
  31. package/dist/src/Entity/ticket/Screen/ticket-react-markdown.js +36 -13
  32. package/dist/src/Entity/ticket/Screen/ticket-react.d.ts +21 -8
  33. package/dist/src/Entity/ticket/Screen/ticket-react.js +109 -34
  34. package/dist/src/Kernel/renderer.d.ts +1 -3
  35. package/dist/src/Kernel/renderer.js +2 -5
  36. package/dist/src/Kernel/tui-kernel.js +7 -16
  37. package/dist/src/Screen/async-screen.d.ts +6 -0
  38. package/dist/src/Screen/async-screen.js +9 -1
  39. package/dist/src/Screen/screen.d.ts +6 -2
  40. package/dist/src/Statistics/comparison-chart.d.ts +4 -2
  41. package/dist/src/Statistics/comparison-chart.js +14 -6
  42. package/dist/src/Statistics/figures.d.ts +17 -3
  43. package/dist/src/Statistics/figures.js +104 -41
  44. package/dist/src/Statistics/presentation.d.ts +3 -5
  45. package/dist/src/Statistics/presentation.js +3 -5
  46. package/dist/src/Statistics/screen.d.ts +16 -5
  47. package/dist/src/Statistics/screen.js +59 -26
  48. package/dist/src/lib/theme.d.ts +0 -56
  49. package/dist/src/lib/theme.js +0 -42
  50. package/dist/src/lib/vnode.d.ts +29 -0
  51. package/dist/src/lib/vnode.js +69 -0
  52. package/dist/src/ui.d.ts +0 -1
  53. package/dist/src/ui.js +0 -1
  54. package/package.json +3 -6
  55. package/dist/src/Agent/Component/agent-list/index.d.ts +0 -6
  56. package/dist/src/Agent/Component/agent-list/index.js +0 -14
  57. package/dist/src/Component/agent-list/index.d.ts +0 -6
  58. package/dist/src/Component/agent-list/index.js +0 -14
  59. package/dist/src/Component/comment-item/index.d.ts +0 -21
  60. package/dist/src/Component/comment-item/index.js +0 -39
  61. package/dist/src/Component/create-form/index.d.ts +0 -3
  62. package/dist/src/Component/create-form/index.js +0 -26
  63. package/dist/src/Component/dashboard-list/index.d.ts +0 -8
  64. package/dist/src/Component/dashboard-list/index.js +0 -7
  65. package/dist/src/Component/project-picker/index.d.ts +0 -15
  66. package/dist/src/Component/project-picker/index.js +0 -42
  67. package/dist/src/Component/run-table/index.d.ts +0 -10
  68. package/dist/src/Component/run-table/index.js +0 -20
  69. package/dist/src/Component/tab-bar/index.d.ts +0 -20
  70. package/dist/src/Component/tab-bar/index.js +0 -42
  71. package/dist/src/Component/ticket-detail/index.d.ts +0 -38
  72. package/dist/src/Component/ticket-detail/index.js +0 -193
  73. package/dist/src/Component/ticket-table/index.d.ts +0 -5
  74. package/dist/src/Component/ticket-table/index.js +0 -14
  75. package/dist/src/Component/ticket-teaser/index.d.ts +0 -7
  76. package/dist/src/Component/ticket-teaser/index.js +0 -76
  77. package/dist/src/Deriver/liveness.d.ts +0 -12
  78. package/dist/src/Deriver/liveness.js +0 -34
  79. package/dist/src/Deriver/run-status.d.ts +0 -12
  80. package/dist/src/Deriver/run-status.js +0 -36
  81. package/dist/src/Entity/conductor/Component/conductor-list/index.d.ts +0 -25
  82. package/dist/src/Entity/conductor/Component/conductor-list/index.js +0 -60
  83. package/dist/src/Entity/project/Component/dashboard-list/index.d.ts +0 -8
  84. package/dist/src/Entity/project/Component/dashboard-list/index.js +0 -7
  85. package/dist/src/Entity/project/Component/project-list/index.d.ts +0 -8
  86. package/dist/src/Entity/project/Component/project-list/index.js +0 -7
  87. package/dist/src/Entity/project/Component/project-picker/index.d.ts +0 -15
  88. package/dist/src/Entity/project/Component/project-picker/index.js +0 -42
  89. package/dist/src/Entity/project/Screen/project-work.d.ts +0 -33
  90. package/dist/src/Entity/project/Screen/project-work.js +0 -114
  91. package/dist/src/Entity/run/Component/run-table/index.d.ts +0 -8
  92. package/dist/src/Entity/run/Component/run-table/index.js +0 -11
  93. package/dist/src/Entity/statistics/Data/statistics.d.ts +0 -147
  94. package/dist/src/Entity/statistics/Data/statistics.js +0 -235
  95. package/dist/src/Entity/statistics/Screen/dashboard.d.ts +0 -70
  96. package/dist/src/Entity/statistics/Screen/dashboard.js +0 -216
  97. package/dist/src/Entity/statistics/render.d.ts +0 -6
  98. package/dist/src/Entity/statistics/render.js +0 -71
  99. package/dist/src/Entity/ticket/Component/tab-bar/index.d.ts +0 -20
  100. package/dist/src/Entity/ticket/Component/tab-bar/index.js +0 -71
  101. package/dist/src/Entity/ticket/Component/ticket-table/index.d.ts +0 -7
  102. package/dist/src/Entity/ticket/Component/ticket-table/index.js +0 -10
  103. package/dist/src/Entity/user/Screen/user-overview.d.ts +0 -33
  104. package/dist/src/Entity/user/Screen/user-overview.js +0 -80
  105. package/dist/src/Extension/contract.d.ts +0 -204
  106. package/dist/src/Extension/contract.js +0 -1
  107. package/dist/src/Kernel/react-body.d.ts +0 -9
  108. package/dist/src/Kernel/react-body.js +0 -42
  109. package/dist/src/Screen/async-react-screen.d.ts +0 -45
  110. package/dist/src/Screen/async-react-screen.js +0 -120
  111. package/dist/src/Screen/dashboard.d.ts +0 -1
  112. package/dist/src/Screen/dashboard.js +0 -1
  113. package/dist/src/Screen/project.d.ts +0 -1
  114. package/dist/src/Screen/project.js +0 -1
  115. package/dist/src/Screen/projects.d.ts +0 -1
  116. package/dist/src/Screen/projects.js +0 -1
  117. package/dist/src/Screen/react-screen.d.ts +0 -14
  118. package/dist/src/Screen/react-screen.js +0 -34
  119. package/dist/src/Screen/ticket.d.ts +0 -1
  120. package/dist/src/Screen/ticket.js +0 -1
  121. package/dist/src/Service/agent.d.ts +0 -17
  122. package/dist/src/Service/agent.js +0 -28
  123. package/dist/src/Service/create-form-data.d.ts +0 -10
  124. package/dist/src/Service/create-form-data.js +0 -52
  125. package/dist/src/Service/create-form.d.ts +0 -52
  126. package/dist/src/Service/create-form.js +0 -98
  127. package/dist/src/Service/project-data.d.ts +0 -48
  128. package/dist/src/Service/project-data.js +0 -92
  129. package/dist/src/Service/projects.d.ts +0 -21
  130. package/dist/src/Service/projects.js +0 -80
  131. package/dist/src/Service/route.d.ts +0 -11
  132. package/dist/src/Service/route.js +0 -215
  133. package/dist/src/Service/run-data.d.ts +0 -35
  134. package/dist/src/Service/run-data.js +0 -62
  135. package/dist/src/Service/ticket-data.d.ts +0 -6
  136. package/dist/src/Service/ticket-data.js +0 -7
  137. package/dist/src/Tui/controller.d.ts +0 -13
  138. package/dist/src/Tui/controller.js +0 -1794
  139. package/dist/src/Vendor/termcn/hooks/use-motion.d.ts +0 -5
  140. package/dist/src/Vendor/termcn/hooks/use-motion.js +0 -7
  141. package/dist/src/Vendor/termcn/hooks/use-theme.d.ts +0 -5
  142. package/dist/src/Vendor/termcn/hooks/use-theme.js +0 -10
  143. package/dist/src/Vendor/termcn/hooks/use-unicode.d.ts +0 -5
  144. package/dist/src/Vendor/termcn/hooks/use-unicode.js +0 -34
  145. package/dist/src/Vendor/termcn/lib/dither-chart-utils.d.ts +0 -130
  146. package/dist/src/Vendor/termcn/lib/dither-chart-utils.js +0 -357
  147. package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.d.ts +0 -2
  148. package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.js +0 -72
  149. package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.d.ts +0 -2
  150. package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.js +0 -113
  151. package/dist/src/Vendor/termcn/themes/default.d.ts +0 -1
  152. package/dist/src/Vendor/termcn/themes/default.js +0 -3
  153. package/dist/src/Vendor/termcn/ui/badge.d.ts +0 -13
  154. package/dist/src/Vendor/termcn/ui/badge.js +0 -33
  155. package/dist/src/Vendor/termcn/ui/bar-chart.d.ts +0 -16
  156. package/dist/src/Vendor/termcn/ui/bar-chart.js +0 -61
  157. package/dist/src/Vendor/termcn/ui/card.d.ts +0 -18
  158. package/dist/src/Vendor/termcn/ui/card.js +0 -7
  159. package/dist/src/Vendor/termcn/ui/dither-chart.d.ts +0 -118
  160. package/dist/src/Vendor/termcn/ui/dither-chart.js +0 -418
  161. package/dist/src/Vendor/termcn/ui/dither-line-chart.d.ts +0 -10
  162. package/dist/src/Vendor/termcn/ui/dither-line-chart.js +0 -11
  163. package/dist/src/Vendor/termcn/ui/dither-radar-chart.d.ts +0 -21
  164. package/dist/src/Vendor/termcn/ui/dither-radar-chart.js +0 -11
  165. package/dist/src/Vendor/termcn/ui/divider.d.ts +0 -14
  166. package/dist/src/Vendor/termcn/ui/divider.js +0 -25
  167. package/dist/src/Vendor/termcn/ui/gauge.d.ts +0 -12
  168. package/dist/src/Vendor/termcn/ui/gauge.js +0 -48
  169. package/dist/src/Vendor/termcn/ui/heat-map.d.ts +0 -13
  170. package/dist/src/Vendor/termcn/ui/heat-map.js +0 -59
  171. package/dist/src/Vendor/termcn/ui/key-value.d.ts +0 -16
  172. package/dist/src/Vendor/termcn/ui/key-value.js +0 -24
  173. package/dist/src/Vendor/termcn/ui/line-chart.d.ts +0 -15
  174. package/dist/src/Vendor/termcn/ui/line-chart.js +0 -102
  175. package/dist/src/Vendor/termcn/ui/markdown.d.ts +0 -24
  176. package/dist/src/Vendor/termcn/ui/markdown.js +0 -39
  177. package/dist/src/Vendor/termcn/ui/progress-bar.d.ts +0 -13
  178. package/dist/src/Vendor/termcn/ui/progress-bar.js +0 -13
  179. package/dist/src/Vendor/termcn/ui/sparkline.d.ts +0 -8
  180. package/dist/src/Vendor/termcn/ui/sparkline.js +0 -30
  181. package/dist/src/Vendor/termcn/ui/types.d.ts +0 -82
  182. package/dist/src/Vendor/termcn/ui/types.js +0 -1
  183. package/dist/src/lib/ansi.d.ts +0 -34
  184. package/dist/src/lib/ansi.js +0 -97
  185. package/dist/src/lib/hit-test.d.ts +0 -138
  186. package/dist/src/lib/hit-test.js +0 -138
  187. package/dist/src/lib/mouse.d.ts +0 -35
  188. package/dist/src/lib/mouse.js +0 -89
  189. package/dist/src/lib/table.d.ts +0 -37
  190. package/dist/src/lib/table.js +0 -20
  191. package/dist/src/lib/ticket-query.d.ts +0 -21
  192. package/dist/src/lib/ticket-query.js +0 -72
@@ -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;