tinytsdk 0.2.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 +130 -0
- package/dist/client.d.ts +58 -0
- package/dist/index.cjs.js +382 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +355 -0
- package/dist/proto.d.ts +111 -0
- package/dist/react/MetricsBar.d.ts +13 -0
- package/dist/react/MetricsPanel.d.ts +8 -0
- package/dist/react/TinyTrackProvider.d.ts +30 -0
- package/dist/react/dashboard/Dashboard.d.ts +11 -0
- package/dist/react/dashboard/Sparkline.d.ts +10 -0
- package/dist/react/dashboard/TimeSeriesChart.d.ts +12 -0
- package/dist/react/dashboard/Timeline.d.ts +13 -0
- package/dist/react/dashboard/utils.d.ts +16 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/theme.d.ts +111 -0
- package/dist/react.cjs.js +1217 -0
- package/dist/react.esm.js +1203 -0
- package/dist/stories/Dashboard.stories.d.ts +9 -0
- package/dist/stories/MetricsBar.stories.d.ts +12 -0
- package/dist/stories/MetricsPanel.stories.d.ts +8 -0
- package/dist/stories/MockProvider.d.ts +20 -0
- package/dist/stories/TimeSeriesChart.stories.d.ts +12 -0
- package/dist/stories/Timeline.stories.d.ts +11 -0
- package/package.json +76 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export interface TtTheme {
|
|
3
|
+
/** Component background */
|
|
4
|
+
bg: string;
|
|
5
|
+
/** Elevated surface (rows, cards) */
|
|
6
|
+
surface: string;
|
|
7
|
+
/** Border color */
|
|
8
|
+
border: string;
|
|
9
|
+
/** Divider / subtle separator */
|
|
10
|
+
divider: string;
|
|
11
|
+
/** Primary text */
|
|
12
|
+
text: string;
|
|
13
|
+
/** Secondary / muted text */
|
|
14
|
+
muted: string;
|
|
15
|
+
/** Faint / disabled text */
|
|
16
|
+
faint: string;
|
|
17
|
+
/** Accent colors per metric */
|
|
18
|
+
cpu: string;
|
|
19
|
+
mem: string;
|
|
20
|
+
net: string;
|
|
21
|
+
disk: string;
|
|
22
|
+
load: string;
|
|
23
|
+
/** Status colors */
|
|
24
|
+
ok: string;
|
|
25
|
+
warn: string;
|
|
26
|
+
crit: string;
|
|
27
|
+
/** UI chrome */
|
|
28
|
+
btnBg: string;
|
|
29
|
+
btnText: string;
|
|
30
|
+
/** Font family */
|
|
31
|
+
font: string;
|
|
32
|
+
/** Border radius (px) */
|
|
33
|
+
radius: number;
|
|
34
|
+
/** Optional glow/shadow for accents (CSS box-shadow value or empty string) */
|
|
35
|
+
glow?: string;
|
|
36
|
+
/** Transition for animated values */
|
|
37
|
+
transition?: string;
|
|
38
|
+
}
|
|
39
|
+
export type ThemePreset = 'terminal' | 'dark' | 'light' | 'material' | 'dracula' | 'heroui';
|
|
40
|
+
export declare const THEMES: Record<ThemePreset, TtTheme>;
|
|
41
|
+
export declare function useTheme(): TtTheme;
|
|
42
|
+
export interface ThemeProviderProps {
|
|
43
|
+
/** Built-in preset name. Default: 'terminal' */
|
|
44
|
+
preset?: ThemePreset;
|
|
45
|
+
/** Override individual tokens on top of the preset */
|
|
46
|
+
theme?: Partial<TtTheme>;
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export declare function ThemeProvider({ preset, theme, children }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function themeStyles(t: TtTheme): {
|
|
51
|
+
root: {
|
|
52
|
+
fontFamily: string;
|
|
53
|
+
fontSize: number;
|
|
54
|
+
background: string;
|
|
55
|
+
color: string;
|
|
56
|
+
border: string;
|
|
57
|
+
borderRadius: number;
|
|
58
|
+
padding: string;
|
|
59
|
+
display: "flex";
|
|
60
|
+
flexDirection: "column";
|
|
61
|
+
gap: number;
|
|
62
|
+
boxSizing: "border-box";
|
|
63
|
+
boxShadow: string | undefined;
|
|
64
|
+
transition: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
divider: {
|
|
67
|
+
height: number;
|
|
68
|
+
background: string;
|
|
69
|
+
margin: string;
|
|
70
|
+
};
|
|
71
|
+
label: {
|
|
72
|
+
color: string;
|
|
73
|
+
whiteSpace: "nowrap";
|
|
74
|
+
};
|
|
75
|
+
value: {
|
|
76
|
+
color: string;
|
|
77
|
+
whiteSpace: "nowrap";
|
|
78
|
+
minWidth: number;
|
|
79
|
+
display: "inline-block";
|
|
80
|
+
};
|
|
81
|
+
numval: {
|
|
82
|
+
color: string;
|
|
83
|
+
whiteSpace: "nowrap";
|
|
84
|
+
minWidth: number;
|
|
85
|
+
display: "inline-block";
|
|
86
|
+
fontVariantNumeric: "tabular-nums";
|
|
87
|
+
};
|
|
88
|
+
btn: {
|
|
89
|
+
fontSize: number;
|
|
90
|
+
padding: string;
|
|
91
|
+
background: string;
|
|
92
|
+
border: string;
|
|
93
|
+
borderRadius: number;
|
|
94
|
+
color: string;
|
|
95
|
+
cursor: "pointer";
|
|
96
|
+
transition: string | undefined;
|
|
97
|
+
fontFamily: string;
|
|
98
|
+
};
|
|
99
|
+
select: {
|
|
100
|
+
fontSize: number;
|
|
101
|
+
background: string;
|
|
102
|
+
border: string;
|
|
103
|
+
borderRadius: number;
|
|
104
|
+
color: string;
|
|
105
|
+
padding: string;
|
|
106
|
+
cursor: "pointer";
|
|
107
|
+
fontFamily: string;
|
|
108
|
+
};
|
|
109
|
+
badge: (color: string) => CSSProperties;
|
|
110
|
+
alert: (level: "warn" | "crit" | "ok") => CSSProperties;
|
|
111
|
+
};
|