@kopai/ui 0.4.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.4.0",
3
+ "version": "0.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Vladimir Adamic",
6
6
  "repository": {
@@ -40,20 +40,20 @@
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"
@@ -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" })}