@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.
- package/dist/src/Component/badge/index.d.ts +11 -0
- package/dist/src/Component/badge/index.js +10 -0
- package/dist/src/Component/bar-chart/index.d.ts +16 -0
- package/dist/src/Component/bar-chart/index.js +63 -0
- package/dist/src/Component/card/index.d.ts +16 -0
- package/dist/src/Component/card/index.js +39 -0
- package/dist/src/Component/divider/index.d.ts +7 -0
- package/dist/src/Component/divider/index.js +13 -0
- package/dist/src/Component/heat-map/index.d.ts +21 -0
- package/dist/src/Component/heat-map/index.js +86 -0
- package/dist/src/Component/key-value/index.d.ts +18 -0
- package/dist/src/Component/key-value/index.js +30 -0
- package/dist/src/Component/markdown/index.d.ts +35 -5
- package/dist/src/Component/markdown/index.js +72 -16
- package/dist/src/Entity/team/Data/workload.d.ts +3 -1
- package/dist/src/Entity/team/Data/workload.js +6 -4
- package/dist/src/Entity/team/Screen/team-work.d.ts +12 -1
- package/dist/src/Entity/team/Screen/team-work.js +47 -2
- package/dist/src/Entity/ticket/Component/demo-statistics.d.ts +14 -0
- package/dist/src/Entity/ticket/Component/demo-statistics.js +88 -0
- package/dist/src/Entity/ticket/Component/react-statistics.d.ts +14 -22
- package/dist/src/Entity/ticket/Component/react-statistics.js +21 -42
- package/dist/src/Entity/ticket/Component/ticket-content/index.d.ts +28 -3
- package/dist/src/Entity/ticket/Component/ticket-content/index.js +331 -157
- package/dist/src/Entity/ticket/Data/parents.js +1 -1
- package/dist/src/Entity/ticket/Data/query.d.ts +2 -2
- package/dist/src/Entity/ticket/Data/query.js +13 -9
- package/dist/src/Entity/ticket/Data/store.js +1 -1
- package/dist/src/Entity/ticket/Data/tickets.d.ts +1 -1
- package/dist/src/Entity/ticket/Data/tickets.js +1 -1
- package/dist/src/Entity/ticket/Form/edit.d.ts +13 -0
- package/dist/src/Entity/ticket/Form/edit.js +17 -7
- package/dist/src/Entity/ticket/Screen/conductor-tickets.d.ts +7 -1
- package/dist/src/Entity/ticket/Screen/conductor-tickets.js +30 -6
- package/dist/src/Entity/ticket/Screen/edit-assignment-form.d.ts +3 -1
- package/dist/src/Entity/ticket/Screen/edit-assignment-form.js +21 -6
- package/dist/src/Entity/ticket/Screen/my-work.d.ts +8 -1
- package/dist/src/Entity/ticket/Screen/my-work.js +37 -4
- package/dist/src/Entity/ticket/Screen/ticket-comments.d.ts +6 -12
- package/dist/src/Entity/ticket/Screen/ticket-comments.js +11 -16
- package/dist/src/Entity/ticket/Screen/ticket-content-screen.d.ts +25 -44
- package/dist/src/Entity/ticket/Screen/ticket-content-screen.js +79 -87
- package/dist/src/Entity/ticket/Screen/ticket-detail.d.ts +6 -11
- package/dist/src/Entity/ticket/Screen/ticket-detail.js +14 -19
- package/dist/src/Entity/ticket/Screen/ticket-filter-bar.js +2 -9
- package/dist/src/Entity/ticket/Screen/ticket-planning.d.ts +6 -12
- package/dist/src/Entity/ticket/Screen/ticket-planning.js +11 -16
- package/dist/src/Entity/ticket/Screen/ticket-react-markdown.d.ts +9 -7
- package/dist/src/Entity/ticket/Screen/ticket-react-markdown.js +36 -13
- package/dist/src/Entity/ticket/Screen/ticket-react.d.ts +21 -8
- package/dist/src/Entity/ticket/Screen/ticket-react.js +109 -34
- package/dist/src/Entity/ticket/Screen/ticket-search.d.ts +44 -0
- package/dist/src/Entity/ticket/Screen/ticket-search.js +97 -0
- package/dist/src/Entity/ticket/Screen/tickets.d.ts +9 -7
- package/dist/src/Entity/ticket/Screen/tickets.js +25 -85
- package/dist/src/Entity/ticket/Screen/user-tickets.d.ts +7 -0
- package/dist/src/Entity/ticket/Screen/user-tickets.js +30 -2
- package/dist/src/Kernel/renderer.d.ts +1 -3
- package/dist/src/Kernel/renderer.js +2 -5
- package/dist/src/Kernel/tui-kernel.js +7 -16
- package/dist/src/Screen/async-screen.d.ts +13 -0
- package/dist/src/Screen/async-screen.js +34 -5
- package/dist/src/Screen/list-screen.d.ts +11 -2
- package/dist/src/Screen/list-screen.js +20 -2
- package/dist/src/Screen/screen.d.ts +6 -2
- package/dist/src/Statistics/comparison-chart.d.ts +4 -2
- package/dist/src/Statistics/comparison-chart.js +14 -6
- package/dist/src/Statistics/figures.d.ts +17 -3
- package/dist/src/Statistics/figures.js +104 -41
- package/dist/src/Statistics/presentation.d.ts +3 -5
- package/dist/src/Statistics/presentation.js +3 -5
- package/dist/src/Statistics/screen.d.ts +16 -5
- package/dist/src/Statistics/screen.js +59 -26
- package/dist/src/lib/theme.d.ts +0 -56
- package/dist/src/lib/theme.js +0 -42
- package/dist/src/lib/vnode.d.ts +29 -0
- package/dist/src/lib/vnode.js +69 -0
- package/dist/src/route.js +37 -0
- package/dist/src/types.d.ts +5 -1
- package/dist/src/ui.d.ts +0 -1
- package/dist/src/ui.js +0 -1
- package/package.json +2 -2
- package/dist/src/Agent/Component/agent-list/index.d.ts +0 -6
- package/dist/src/Agent/Component/agent-list/index.js +0 -14
- package/dist/src/Component/agent-list/index.d.ts +0 -6
- package/dist/src/Component/agent-list/index.js +0 -14
- package/dist/src/Component/comment-item/index.d.ts +0 -21
- package/dist/src/Component/comment-item/index.js +0 -39
- package/dist/src/Component/create-form/index.d.ts +0 -3
- package/dist/src/Component/create-form/index.js +0 -26
- package/dist/src/Component/dashboard-list/index.d.ts +0 -8
- package/dist/src/Component/dashboard-list/index.js +0 -7
- package/dist/src/Component/project-picker/index.d.ts +0 -15
- package/dist/src/Component/project-picker/index.js +0 -42
- package/dist/src/Component/run-table/index.d.ts +0 -10
- package/dist/src/Component/run-table/index.js +0 -20
- package/dist/src/Component/tab-bar/index.d.ts +0 -20
- package/dist/src/Component/tab-bar/index.js +0 -42
- package/dist/src/Component/ticket-detail/index.d.ts +0 -38
- package/dist/src/Component/ticket-detail/index.js +0 -193
- package/dist/src/Component/ticket-table/index.d.ts +0 -5
- package/dist/src/Component/ticket-table/index.js +0 -14
- package/dist/src/Component/ticket-teaser/index.d.ts +0 -7
- package/dist/src/Component/ticket-teaser/index.js +0 -76
- package/dist/src/Deriver/liveness.d.ts +0 -12
- package/dist/src/Deriver/liveness.js +0 -34
- package/dist/src/Deriver/run-status.d.ts +0 -12
- package/dist/src/Deriver/run-status.js +0 -36
- package/dist/src/Entity/conductor/Component/conductor-list/index.d.ts +0 -25
- package/dist/src/Entity/conductor/Component/conductor-list/index.js +0 -60
- package/dist/src/Entity/project/Component/dashboard-list/index.d.ts +0 -8
- package/dist/src/Entity/project/Component/dashboard-list/index.js +0 -7
- package/dist/src/Entity/project/Component/project-list/index.d.ts +0 -8
- package/dist/src/Entity/project/Component/project-list/index.js +0 -7
- package/dist/src/Entity/project/Component/project-picker/index.d.ts +0 -15
- package/dist/src/Entity/project/Component/project-picker/index.js +0 -42
- package/dist/src/Entity/project/Screen/project-work.d.ts +0 -33
- package/dist/src/Entity/project/Screen/project-work.js +0 -114
- package/dist/src/Entity/run/Component/run-table/index.d.ts +0 -8
- package/dist/src/Entity/run/Component/run-table/index.js +0 -11
- package/dist/src/Entity/statistics/Data/statistics.d.ts +0 -147
- package/dist/src/Entity/statistics/Data/statistics.js +0 -235
- package/dist/src/Entity/statistics/Screen/dashboard.d.ts +0 -70
- package/dist/src/Entity/statistics/Screen/dashboard.js +0 -216
- package/dist/src/Entity/statistics/render.d.ts +0 -6
- package/dist/src/Entity/statistics/render.js +0 -71
- package/dist/src/Entity/ticket/Component/tab-bar/index.d.ts +0 -20
- package/dist/src/Entity/ticket/Component/tab-bar/index.js +0 -71
- package/dist/src/Entity/ticket/Component/ticket-table/index.d.ts +0 -7
- package/dist/src/Entity/ticket/Component/ticket-table/index.js +0 -10
- package/dist/src/Entity/user/Screen/user-overview.d.ts +0 -33
- package/dist/src/Entity/user/Screen/user-overview.js +0 -80
- package/dist/src/Extension/contract.d.ts +0 -204
- package/dist/src/Extension/contract.js +0 -1
- package/dist/src/Kernel/react-body.d.ts +0 -9
- package/dist/src/Kernel/react-body.js +0 -42
- package/dist/src/Screen/async-react-screen.d.ts +0 -45
- package/dist/src/Screen/async-react-screen.js +0 -120
- package/dist/src/Screen/dashboard.d.ts +0 -1
- package/dist/src/Screen/dashboard.js +0 -1
- package/dist/src/Screen/project.d.ts +0 -1
- package/dist/src/Screen/project.js +0 -1
- package/dist/src/Screen/projects.d.ts +0 -1
- package/dist/src/Screen/projects.js +0 -1
- package/dist/src/Screen/react-screen.d.ts +0 -14
- package/dist/src/Screen/react-screen.js +0 -34
- package/dist/src/Screen/ticket.d.ts +0 -1
- package/dist/src/Screen/ticket.js +0 -1
- package/dist/src/Service/agent.d.ts +0 -17
- package/dist/src/Service/agent.js +0 -28
- package/dist/src/Service/create-form-data.d.ts +0 -10
- package/dist/src/Service/create-form-data.js +0 -52
- package/dist/src/Service/create-form.d.ts +0 -52
- package/dist/src/Service/create-form.js +0 -98
- package/dist/src/Service/project-data.d.ts +0 -48
- package/dist/src/Service/project-data.js +0 -92
- package/dist/src/Service/projects.d.ts +0 -21
- package/dist/src/Service/projects.js +0 -80
- package/dist/src/Service/route.d.ts +0 -11
- package/dist/src/Service/route.js +0 -215
- package/dist/src/Service/run-data.d.ts +0 -35
- package/dist/src/Service/run-data.js +0 -62
- package/dist/src/Service/ticket-data.d.ts +0 -6
- package/dist/src/Service/ticket-data.js +0 -7
- package/dist/src/Tui/controller.d.ts +0 -13
- package/dist/src/Tui/controller.js +0 -1794
- package/dist/src/Vendor/termcn/hooks/use-motion.d.ts +0 -5
- package/dist/src/Vendor/termcn/hooks/use-motion.js +0 -7
- package/dist/src/Vendor/termcn/hooks/use-theme.d.ts +0 -5
- package/dist/src/Vendor/termcn/hooks/use-theme.js +0 -10
- package/dist/src/Vendor/termcn/hooks/use-unicode.d.ts +0 -5
- package/dist/src/Vendor/termcn/hooks/use-unicode.js +0 -34
- package/dist/src/Vendor/termcn/lib/dither-chart-utils.d.ts +0 -130
- package/dist/src/Vendor/termcn/lib/dither-chart-utils.js +0 -357
- package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.d.ts +0 -2
- package/dist/src/Vendor/termcn/lib/dither-line-chart-utils.js +0 -72
- package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.d.ts +0 -2
- package/dist/src/Vendor/termcn/lib/dither-radar-chart-utils.js +0 -113
- package/dist/src/Vendor/termcn/themes/default.d.ts +0 -1
- package/dist/src/Vendor/termcn/themes/default.js +0 -3
- package/dist/src/Vendor/termcn/ui/badge.d.ts +0 -13
- package/dist/src/Vendor/termcn/ui/badge.js +0 -33
- package/dist/src/Vendor/termcn/ui/bar-chart.d.ts +0 -16
- package/dist/src/Vendor/termcn/ui/bar-chart.js +0 -61
- package/dist/src/Vendor/termcn/ui/card.d.ts +0 -18
- package/dist/src/Vendor/termcn/ui/card.js +0 -7
- package/dist/src/Vendor/termcn/ui/dither-chart.d.ts +0 -118
- package/dist/src/Vendor/termcn/ui/dither-chart.js +0 -418
- package/dist/src/Vendor/termcn/ui/dither-line-chart.d.ts +0 -10
- package/dist/src/Vendor/termcn/ui/dither-line-chart.js +0 -11
- package/dist/src/Vendor/termcn/ui/dither-radar-chart.d.ts +0 -21
- package/dist/src/Vendor/termcn/ui/dither-radar-chart.js +0 -11
- package/dist/src/Vendor/termcn/ui/divider.d.ts +0 -14
- package/dist/src/Vendor/termcn/ui/divider.js +0 -25
- package/dist/src/Vendor/termcn/ui/gauge.d.ts +0 -12
- package/dist/src/Vendor/termcn/ui/gauge.js +0 -48
- package/dist/src/Vendor/termcn/ui/heat-map.d.ts +0 -13
- package/dist/src/Vendor/termcn/ui/heat-map.js +0 -59
- package/dist/src/Vendor/termcn/ui/key-value.d.ts +0 -16
- package/dist/src/Vendor/termcn/ui/key-value.js +0 -24
- package/dist/src/Vendor/termcn/ui/line-chart.d.ts +0 -15
- package/dist/src/Vendor/termcn/ui/line-chart.js +0 -102
- package/dist/src/Vendor/termcn/ui/markdown.d.ts +0 -24
- package/dist/src/Vendor/termcn/ui/markdown.js +0 -39
- package/dist/src/Vendor/termcn/ui/progress-bar.d.ts +0 -13
- package/dist/src/Vendor/termcn/ui/progress-bar.js +0 -13
- package/dist/src/Vendor/termcn/ui/sparkline.d.ts +0 -8
- package/dist/src/Vendor/termcn/ui/sparkline.js +0 -30
- package/dist/src/Vendor/termcn/ui/types.d.ts +0 -82
- package/dist/src/Vendor/termcn/ui/types.js +0 -1
- package/dist/src/lib/ansi.d.ts +0 -34
- package/dist/src/lib/ansi.js +0 -97
- package/dist/src/lib/hit-test.d.ts +0 -138
- package/dist/src/lib/hit-test.js +0 -138
- package/dist/src/lib/mouse.d.ts +0 -35
- package/dist/src/lib/mouse.js +0 -89
- package/dist/src/lib/table.d.ts +0 -37
- package/dist/src/lib/table.js +0 -20
- package/dist/src/lib/ticket-query.d.ts +0 -21
- 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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
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
|
-
|
|
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;
|