@getcatalystiq/agent-plane-ui 0.1.19 → 0.1.21

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.
@@ -1,14 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var React3 = require('react');
3
+ var React4 = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
- var useSWR = require('swr');
6
5
  var clsx = require('clsx');
7
6
  var tailwindMerge = require('tailwind-merge');
8
7
  var classVarianceAuthority = require('class-variance-authority');
9
8
 
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
-
12
9
  function _interopNamespace(e) {
13
10
  if (e && e.__esModule) return e;
14
11
  var n = Object.create(null);
@@ -27,11 +24,10 @@ function _interopNamespace(e) {
27
24
  return Object.freeze(n);
28
25
  }
29
26
 
30
- var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
31
- var useSWR__default = /*#__PURE__*/_interopDefault(useSWR);
27
+ var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
32
28
 
33
- var ClientContext = React3.createContext(null);
34
- var NavigationContext = React3.createContext(
29
+ var ClientContext = React4.createContext(null);
30
+ var NavigationContext = React4.createContext(
35
31
  null
36
32
  );
37
33
  function DefaultLink({ href, children, className }) {
@@ -45,11 +41,11 @@ function AgentPlaneProvider({
45
41
  basePath = "",
46
42
  children
47
43
  }) {
48
- const clientRef = React3.useRef(client);
44
+ const clientRef = React4.useRef(client);
49
45
  clientRef.current = client;
50
- const onAuthErrorRef = React3.useRef(onAuthError);
46
+ const onAuthErrorRef = React4.useRef(onAuthError);
51
47
  onAuthErrorRef.current = onAuthError;
52
- const clientValue = React3.useMemo(
48
+ const clientValue = React4.useMemo(
53
49
  () => ({
54
50
  // Expose a stable object whose `.client` always points to the latest ref.
55
51
  get client() {
@@ -62,7 +58,7 @@ function AgentPlaneProvider({
62
58
  // eslint-disable-next-line react-hooks/exhaustive-deps -- intentionally stable
63
59
  []
64
60
  );
65
- const navigationValue = React3.useMemo(
61
+ const navigationValue = React4.useMemo(
66
62
  () => ({
67
63
  onNavigate,
68
64
  LinkComponent,
@@ -73,7 +69,7 @@ function AgentPlaneProvider({
73
69
  return /* @__PURE__ */ jsxRuntime.jsx(ClientContext.Provider, { value: clientValue, children: /* @__PURE__ */ jsxRuntime.jsx(NavigationContext.Provider, { value: navigationValue, children }) });
74
70
  }
75
71
  function useAgentPlaneClient() {
76
- const ctx = React3.useContext(ClientContext);
72
+ const ctx = React4.useContext(ClientContext);
77
73
  if (!ctx) {
78
74
  throw new Error(
79
75
  "useAgentPlaneClient must be used within an <AgentPlaneProvider>"
@@ -82,7 +78,7 @@ function useAgentPlaneClient() {
82
78
  return ctx.client;
83
79
  }
84
80
  function useAuthError() {
85
- const ctx = React3.useContext(ClientContext);
81
+ const ctx = React4.useContext(ClientContext);
86
82
  if (!ctx) {
87
83
  throw new Error(
88
84
  "useAuthError must be used within an <AgentPlaneProvider>"
@@ -91,7 +87,7 @@ function useAuthError() {
91
87
  return ctx.onAuthError;
92
88
  }
93
89
  function useNavigation() {
94
- const ctx = React3.useContext(NavigationContext);
90
+ const ctx = React4.useContext(NavigationContext);
95
91
  if (!ctx) {
96
92
  throw new Error(
97
93
  "useNavigation must be used within an <AgentPlaneProvider>"
@@ -99,24 +95,6 @@ function useNavigation() {
99
95
  }
100
96
  return ctx;
101
97
  }
102
- function useApi(key, fetcher, options) {
103
- const client = useAgentPlaneClient();
104
- const onAuthError = useAuthError();
105
- return useSWR__default.default(
106
- key,
107
- () => fetcher(client),
108
- {
109
- revalidateOnFocus: false,
110
- errorRetryCount: 3,
111
- onError: (err) => {
112
- if (onAuthError && err && typeof err === "object" && "status" in err && err.status === 401) {
113
- onAuthError(err instanceof Error ? err : new Error(String(err)));
114
- }
115
- },
116
- ...options
117
- }
118
- );
119
- }
120
98
  function cn(...inputs) {
121
99
  return tailwindMerge.twMerge(clsx.clsx(inputs));
122
100
  }
@@ -148,7 +126,7 @@ var buttonVariants = classVarianceAuthority.cva(
148
126
  }
149
127
  }
150
128
  );
151
- var Button = React3__namespace.forwardRef(
129
+ var Button = React4__namespace.forwardRef(
152
130
  ({ className, variant, size, ...props }, ref) => {
153
131
  return /* @__PURE__ */ jsxRuntime.jsx(
154
132
  "button",
@@ -161,26 +139,6 @@ var Button = React3__namespace.forwardRef(
161
139
  }
162
140
  );
163
141
  Button.displayName = "Button";
164
- var Card = React3__namespace.forwardRef(
165
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("rounded-xl border bg-card text-card-foreground shadow", className), ...props })
166
- );
167
- Card.displayName = "Card";
168
- var CardHeader = React3__namespace.forwardRef(
169
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })
170
- );
171
- CardHeader.displayName = "CardHeader";
172
- var CardTitle = React3__namespace.forwardRef(
173
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("font-semibold leading-none tracking-tight", className), ...props })
174
- );
175
- CardTitle.displayName = "CardTitle";
176
- var CardDescription = React3__namespace.forwardRef(
177
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("text-sm text-muted-foreground", className), ...props })
178
- );
179
- CardDescription.displayName = "CardDescription";
180
- var CardContent = React3__namespace.forwardRef(
181
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-6 pt-0", className), ...props })
182
- );
183
- CardContent.displayName = "CardContent";
184
142
  var badgeVariants = classVarianceAuthority.cva(
185
143
  "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
186
144
  {
@@ -200,7 +158,7 @@ var badgeVariants = classVarianceAuthority.cva(
200
158
  function Badge({ className, variant, ...props }) {
201
159
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
202
160
  }
203
- var Input = React3__namespace.forwardRef(
161
+ var Input = React4__namespace.forwardRef(
204
162
  ({ className, type, ...props }, ref) => {
205
163
  return /* @__PURE__ */ jsxRuntime.jsx(
206
164
  "input",
@@ -225,11 +183,8 @@ function FormField({ label, children, error, hint }) {
225
183
  error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive mt-1", children: error })
226
184
  ] });
227
185
  }
228
- function Skeleton({ className, ...props }) {
229
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("animate-pulse rounded-md bg-muted/50", className), ...props });
230
- }
231
186
  function Dialog({ open, onOpenChange, children }) {
232
- React3__namespace.useEffect(() => {
187
+ React4__namespace.useEffect(() => {
233
188
  if (!open) return;
234
189
  function onKeyDown(e) {
235
190
  if (e.key === "Escape") onOpenChange(false);
@@ -237,7 +192,7 @@ function Dialog({ open, onOpenChange, children }) {
237
192
  document.addEventListener("keydown", onKeyDown);
238
193
  return () => document.removeEventListener("keydown", onKeyDown);
239
194
  }, [open, onOpenChange]);
240
- React3__namespace.useEffect(() => {
195
+ React4__namespace.useEffect(() => {
241
196
  if (!open) return;
242
197
  const prev = document.body.style.overflow;
243
198
  document.body.style.overflow = "hidden";
@@ -297,11 +252,6 @@ function DialogDescription({ className, children, ...props }) {
297
252
  exports.AgentPlaneProvider = AgentPlaneProvider;
298
253
  exports.Badge = Badge;
299
254
  exports.Button = Button;
300
- exports.Card = Card;
301
- exports.CardContent = CardContent;
302
- exports.CardDescription = CardDescription;
303
- exports.CardHeader = CardHeader;
304
- exports.CardTitle = CardTitle;
305
255
  exports.Dialog = Dialog;
306
256
  exports.DialogBody = DialogBody;
307
257
  exports.DialogContent = DialogContent;
@@ -311,12 +261,10 @@ exports.DialogHeader = DialogHeader;
311
261
  exports.DialogTitle = DialogTitle;
312
262
  exports.FormField = FormField;
313
263
  exports.Input = Input;
314
- exports.Skeleton = Skeleton;
315
264
  exports.badgeVariants = badgeVariants;
316
265
  exports.buttonVariants = buttonVariants;
317
266
  exports.cn = cn;
318
267
  exports.supportsClaudeRunner = supportsClaudeRunner;
319
268
  exports.useAgentPlaneClient = useAgentPlaneClient;
320
- exports.useApi = useApi;
321
269
  exports.useAuthError = useAuthError;
322
270
  exports.useNavigation = useNavigation;