@labpane/ui 1.4.2 → 1.5.0
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/README.md +1 -1
- package/dist/index.js +807 -35
- package/dist/index.js.map +4 -4
- package/dist/styles.css +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/theme.d.ts +1 -1
- package/dist/ui/timeline-chart.d.ts +25 -0
- package/dist/ui/timeline-model.d.ts +92 -0
- package/package.json +9 -9
- package/styles.css +9 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type TimelineSeries = {
|
|
2
|
+
start: number;
|
|
3
|
+
interval: number;
|
|
4
|
+
fields: string[];
|
|
5
|
+
points: number[][];
|
|
6
|
+
};
|
|
7
|
+
export type TimelineMetric = {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
unit: string;
|
|
11
|
+
line: string;
|
|
12
|
+
lineLabel?: string;
|
|
13
|
+
band?: [string, string];
|
|
14
|
+
bandLabel?: string;
|
|
15
|
+
context?: string;
|
|
16
|
+
contextLabel?: string;
|
|
17
|
+
status?: string;
|
|
18
|
+
statusLabel?: string;
|
|
19
|
+
stack?: {
|
|
20
|
+
field: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
threshold?: number;
|
|
24
|
+
thresholdLabel?: string;
|
|
25
|
+
rate?: boolean;
|
|
26
|
+
scale?: number;
|
|
27
|
+
digits?: number;
|
|
28
|
+
summary?: "peak" | "mean";
|
|
29
|
+
optional?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare const MINUTE = 60000;
|
|
32
|
+
export declare const HOUR = 3600000;
|
|
33
|
+
export declare const RATE_WINDOW = 5000;
|
|
34
|
+
export declare const fieldIndex: (series: Pick<TimelineSeries, "fields">) => Record<string, number | undefined>;
|
|
35
|
+
export declare function niceStep(span: number, count: number): number;
|
|
36
|
+
export declare function valueTicks(max: number, count?: number): number[];
|
|
37
|
+
export declare function timeTicks(span: number, count?: number): number[];
|
|
38
|
+
export declare function elapsedLabel(ms: number): string;
|
|
39
|
+
export declare const clockLabel: (t: number) => string;
|
|
40
|
+
export declare function compactNumber(value: number, digits?: number): string;
|
|
41
|
+
export declare function bytesLabel(bytes: number): string;
|
|
42
|
+
export declare function linePath(xs: number[], ys: number[]): string;
|
|
43
|
+
export declare function areaPath(xs: number[], highs: number[], lows: number[]): string;
|
|
44
|
+
export declare function nearestIndex(times: number[], t: number): number;
|
|
45
|
+
export declare function rates(points: number[][], index: number, timeIndex?: number, window?: number): number[];
|
|
46
|
+
export declare function summarize(values: number[], busy: boolean[], summary: "peak" | "mean"): number | undefined;
|
|
47
|
+
export declare function timelineValues(series: TimelineSeries, metric: TimelineMetric): {
|
|
48
|
+
times: number[];
|
|
49
|
+
line: number[];
|
|
50
|
+
low: number[] | undefined;
|
|
51
|
+
high: number[] | undefined;
|
|
52
|
+
context: number[] | undefined;
|
|
53
|
+
status: number[] | undefined;
|
|
54
|
+
stack: number[][] | undefined;
|
|
55
|
+
threshold: number | undefined;
|
|
56
|
+
busy: boolean[];
|
|
57
|
+
};
|
|
58
|
+
export declare function hasTimelineData(series: TimelineSeries, metric: TimelineMetric): boolean;
|
|
59
|
+
export declare const formatMetric: (metric: Pick<TimelineMetric, "unit" | "digits">, value: number | undefined) => string;
|
|
60
|
+
export declare function timelineCSV(series: TimelineSeries): string;
|
|
61
|
+
export declare const MIN_SPAN = 60000;
|
|
62
|
+
export declare function timelineModel(series: TimelineSeries, metric: TimelineMetric, width: number, height: number, start?: number): {
|
|
63
|
+
times: number[];
|
|
64
|
+
line: number[];
|
|
65
|
+
low: number[] | undefined;
|
|
66
|
+
high: number[] | undefined;
|
|
67
|
+
context: number[] | undefined;
|
|
68
|
+
status: number[] | undefined;
|
|
69
|
+
stack: number[][] | undefined;
|
|
70
|
+
threshold: number | undefined;
|
|
71
|
+
busy: boolean[];
|
|
72
|
+
x0: number;
|
|
73
|
+
x1: number;
|
|
74
|
+
left: number;
|
|
75
|
+
right: number;
|
|
76
|
+
top: number;
|
|
77
|
+
bottom: number;
|
|
78
|
+
x: (t: number) => number;
|
|
79
|
+
y: (v: number) => number;
|
|
80
|
+
xs: number[];
|
|
81
|
+
yTicks: number[];
|
|
82
|
+
labels: string[];
|
|
83
|
+
totals: number[];
|
|
84
|
+
linePath: string;
|
|
85
|
+
bandPath: string;
|
|
86
|
+
contextPath: string;
|
|
87
|
+
statusPath: string;
|
|
88
|
+
stackPaths: string[];
|
|
89
|
+
separatorPaths: string[];
|
|
90
|
+
xTicks: number[];
|
|
91
|
+
};
|
|
92
|
+
export type TimelineModel = ReturnType<typeof timelineModel>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labpane/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Page layouts, forms, dialogs, menus, tables, and an optional terminal for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://labpane.com",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"clsx": "^2.1.1",
|
|
58
58
|
"cmdk": "^1.1.1",
|
|
59
|
-
"lucide-react": "^1.
|
|
59
|
+
"lucide-react": "^1.64.0",
|
|
60
60
|
"tailwind-merge": "^3.6.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@radix-ui/react-toggle": "^1.1.19",
|
|
75
75
|
"@radix-ui/react-toggle-group": "^1.1.20",
|
|
76
76
|
"@radix-ui/react-tooltip": "^1.3.0",
|
|
77
|
-
"@wterm/dom": "^0.5.
|
|
77
|
+
"@wterm/dom": "^0.5.7",
|
|
78
78
|
"react": "^18.2.0 || ^19.0.0",
|
|
79
79
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
80
80
|
},
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@happy-dom/global-registrator": "^
|
|
87
|
+
"@happy-dom/global-registrator": "^21.0.4",
|
|
88
88
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
89
89
|
"@radix-ui/react-avatar": "^1.2.7",
|
|
90
90
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
@@ -103,14 +103,14 @@
|
|
|
103
103
|
"@testing-library/dom": "^10.4.2",
|
|
104
104
|
"@testing-library/react": "^16.3.3",
|
|
105
105
|
"@testing-library/user-event": "^14.6.7",
|
|
106
|
-
"@types/bun": "^1.4.
|
|
106
|
+
"@types/bun": "^1.4.4",
|
|
107
107
|
"@types/react": "^19.3.0",
|
|
108
108
|
"@types/react-dom": "^19.3.0",
|
|
109
|
-
"@wterm/dom": "^0.5.
|
|
109
|
+
"@wterm/dom": "^0.5.7",
|
|
110
110
|
"esbuild": "^0.28.2",
|
|
111
|
-
"postcss": "^8.5.
|
|
112
|
-
"react": "^19.
|
|
113
|
-
"react-dom": "^19.
|
|
111
|
+
"postcss": "^8.5.32",
|
|
112
|
+
"react": "^19.3.1",
|
|
113
|
+
"react-dom": "^19.3.1",
|
|
114
114
|
"tailwindcss": "^4.3.3",
|
|
115
115
|
"tailwindcss3": "npm:tailwindcss@^3.4.17",
|
|
116
116
|
"typescript": "^7.0.2"
|
package/styles.css
CHANGED
|
@@ -54,6 +54,9 @@
|
|
|
54
54
|
--labui-chart-3: #116d3b;
|
|
55
55
|
--labui-chart-4: #b8741a;
|
|
56
56
|
--labui-chart-5: #7a4ea0;
|
|
57
|
+
--labui-chart-step-1: #59b6c9;
|
|
58
|
+
--labui-chart-step-2: #1d9db4;
|
|
59
|
+
--labui-chart-step-3: #05697a;
|
|
57
60
|
--labui-sidebar: #f6f6f6;
|
|
58
61
|
--labui-sidebar-foreground: #242424;
|
|
59
62
|
--labui-sidebar-primary: #05697a;
|
|
@@ -103,6 +106,9 @@
|
|
|
103
106
|
--labui-chart-3: #3ddc84;
|
|
104
107
|
--labui-chart-4: #e0a84a;
|
|
105
108
|
--labui-chart-5: #b58ce0;
|
|
109
|
+
--labui-chart-step-1: #126b7c;
|
|
110
|
+
--labui-chart-step-2: #1d9db4;
|
|
111
|
+
--labui-chart-step-3: #8fd3e2;
|
|
106
112
|
--labui-sidebar: #202020;
|
|
107
113
|
--labui-sidebar-foreground: #e8e8e8;
|
|
108
114
|
--labui-sidebar-primary: #68bccf;
|
|
@@ -162,6 +168,9 @@
|
|
|
162
168
|
--color-chart-3: var(--labui-chart-3);
|
|
163
169
|
--color-chart-4: var(--labui-chart-4);
|
|
164
170
|
--color-chart-5: var(--labui-chart-5);
|
|
171
|
+
--color-chart-step-1: var(--labui-chart-step-1);
|
|
172
|
+
--color-chart-step-2: var(--labui-chart-step-2);
|
|
173
|
+
--color-chart-step-3: var(--labui-chart-step-3);
|
|
165
174
|
--color-sidebar: var(--labui-sidebar);
|
|
166
175
|
--color-sidebar-foreground: var(--labui-sidebar-foreground);
|
|
167
176
|
--color-sidebar-primary: var(--labui-sidebar-primary);
|