@kopai/ui 0.3.0 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kopai/ui",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Vladimir Adamic",
6
6
  "repository": {
@@ -32,28 +32,28 @@
32
32
  "@tanstack/react-query": "^5",
33
33
  "@tanstack/react-virtual": "^3.11.2",
34
34
  "recharts": "^3.7.0",
35
- "@kopai/core": "0.5.0",
36
- "@kopai/sdk": "0.3.0"
35
+ "@kopai/core": "0.6.0",
36
+ "@kopai/sdk": "0.3.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": "^19.2.4",
40
40
  "react-dom": "^19.2.4"
41
41
  },
42
42
  "devDependencies": {
43
- "@storybook/addon-docs": "^10.2.8",
44
- "@storybook/react": "^10.2.8",
45
- "@storybook/react-vite": "^10.2.8",
43
+ "@storybook/addon-docs": "^10.2.10",
44
+ "@storybook/react": "^10.2.10",
45
+ "@storybook/react-vite": "^10.2.10",
46
46
  "@testing-library/react": "^16.3.0",
47
47
  "@types/react": "^19.2.14",
48
48
  "@types/react-dom": "^19.1.0",
49
49
  "@vitejs/plugin-react": "^5.1.4",
50
- "@tailwindcss/postcss": "^4.1.18",
51
- "jsdom": "^28.0.0",
50
+ "@tailwindcss/postcss": "^4.2.0",
51
+ "jsdom": "^28.1.0",
52
52
  "postcss": "^8.5.3",
53
53
  "react": "^19.2.4",
54
54
  "react-dom": "^19.2.4",
55
- "storybook": "^10.2.8",
56
- "tailwindcss": "^4.1.18",
55
+ "storybook": "^10.2.10",
56
+ "tailwindcss": "^4.2.0",
57
57
  "tsdown": "^0.20.3",
58
58
  "vite": "^7.3.1",
59
59
  "@kopai/tsconfig": "0.2.0"
@@ -72,7 +72,7 @@ function sumPoint(
72
72
  StartTimeUnix: ts(0),
73
73
  Value: value,
74
74
  IsMonotonic: 1,
75
- AggTemporality: "CUMULATIVE",
75
+ AggregationTemporality: "CUMULATIVE",
76
76
  ServiceName: "api-gateway",
77
77
  Attributes: { "http.method": method },
78
78
  ResourceAttributes: {
@@ -126,7 +126,7 @@ export const mockHistogramRows: OtelMetricsRow[] = [
126
126
  Max: 1850,
127
127
  ExplicitBounds: HISTOGRAM_BOUNDS,
128
128
  BucketCounts: [120, 280, 350, 310, 180, 120, 85, 35, 15, 5],
129
- AggTemporality: "CUMULATIVE",
129
+ AggregationTemporality: "CUMULATIVE",
130
130
  Attributes: { "http.method": "GET" },
131
131
  ResourceAttributes: {
132
132
  "service.name": "api-gateway",
@@ -150,7 +150,7 @@ export const mockHistogramRows: OtelMetricsRow[] = [
150
150
  Max: 2100,
151
151
  ExplicitBounds: HISTOGRAM_BOUNDS,
152
152
  BucketCounts: [250, 580, 720, 640, 380, 280, 190, 95, 45, 20],
153
- AggTemporality: "CUMULATIVE",
153
+ AggregationTemporality: "CUMULATIVE",
154
154
  Attributes: { "http.method": "GET" },
155
155
  ResourceAttributes: {
156
156
  "service.name": "api-gateway",
@@ -174,7 +174,7 @@ export const mockHistogramRows: OtelMetricsRow[] = [
174
174
  Max: 1950,
175
175
  ExplicitBounds: HISTOGRAM_BOUNDS,
176
176
  BucketCounts: [380, 850, 1100, 950, 560, 420, 310, 140, 65, 25],
177
- AggTemporality: "CUMULATIVE",
177
+ AggregationTemporality: "CUMULATIVE",
178
178
  Attributes: { "http.method": "GET" },
179
179
  ResourceAttributes: {
180
180
  "service.name": "api-gateway",
@@ -739,9 +739,18 @@ function MetricsTab() {
739
739
  // Page
740
740
  // ---------------------------------------------------------------------------
741
741
 
742
- const client = new KopaiClient({ baseUrl: "/signals" });
742
+ let _defaultClient: KopaiClient | undefined;
743
+ function getDefaultClient() {
744
+ _defaultClient ??= new KopaiClient({ baseUrl: "/signals" });
745
+ return _defaultClient;
746
+ }
747
+
748
+ interface ObservabilityPageProps {
749
+ client?: KopaiClient;
750
+ }
743
751
 
744
- export default function ObservabilityPage() {
752
+ export default function ObservabilityPage({ client }: ObservabilityPageProps) {
753
+ const activeClient = client ?? getDefaultClient();
745
754
  const {
746
755
  tab: activeTab,
747
756
  service: selectedService,
@@ -792,7 +801,7 @@ export default function ObservabilityPage() {
792
801
  }, [selectedService]);
793
802
 
794
803
  return (
795
- <KopaiSDKProvider client={client}>
804
+ <KopaiSDKProvider client={activeClient}>
796
805
  <KeyboardShortcutsProvider
797
806
  onNavigateServices={() => pushURLState({ tab: "services" })}
798
807
  onNavigateLogs={() => pushURLState({ tab: "logs" })}