@aiready/components 0.11.11 → 0.11.15
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/dist/charts/ForceDirectedGraph.js +1 -4
- package/dist/charts/ForceDirectedGraph.js.map +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +9 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +4 -1
- package/dist/components/card.js +27 -1
- package/dist/components/card.js.map +1 -1
- package/dist/index.d.ts +129 -8
- package/dist/index.js +1105 -101
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/charts/ForceDirectedGraph.tsx +10 -17
- package/src/code-block/CodeBlock.tsx +59 -64
- package/src/components/button.tsx +9 -1
- package/src/components/card.tsx +42 -0
- package/src/components/icons.tsx +409 -0
- package/src/components/modal.tsx +96 -0
- package/src/data-display/ScoreCircle.tsx +144 -0
- package/src/data-display/index.ts +2 -7
- package/src/feedback/FeedbackWidget.tsx +121 -0
- package/src/feedback/index.ts +3 -12
- package/src/index.ts +15 -0
- package/src/navigation/Breadcrumb.tsx +26 -52
- package/src/navigation/PlatformShell.tsx +408 -0
- package/src/navigation/index.ts +2 -5
package/dist/index.js
CHANGED
|
@@ -3,7 +3,9 @@ import React2__default, { createContext, forwardRef, useRef, useState, useEffect
|
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { AnimatePresence, motion } from 'framer-motion';
|
|
8
|
+
import { X, MessageSquare, Loader2, Send } from 'lucide-react';
|
|
7
9
|
import { getRating as getRating$1 } from '@aiready/core/client';
|
|
8
10
|
import * as d33 from 'd3';
|
|
9
11
|
|
|
@@ -12,7 +14,7 @@ function cn(...inputs) {
|
|
|
12
14
|
return twMerge(clsx(inputs));
|
|
13
15
|
}
|
|
14
16
|
var buttonVariants = cva(
|
|
15
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-
|
|
17
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
16
18
|
{
|
|
17
19
|
variants: {
|
|
18
20
|
variant: {
|
|
@@ -21,13 +23,19 @@ var buttonVariants = cva(
|
|
|
21
23
|
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
22
24
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
23
25
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
24
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
26
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
27
|
+
// Platform specific high-polish variants
|
|
28
|
+
glow: "bg-gradient-to-r from-cyan-600 to-blue-600 text-white shadow-lg shadow-cyan-500/20 hover:shadow-cyan-500/40 hover:scale-[1.02] active:scale-[0.98]",
|
|
29
|
+
glass: "bg-slate-800/50 backdrop-blur-sm border border-slate-700 text-slate-200 hover:bg-slate-700/50 hover:text-white",
|
|
30
|
+
accent: "bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 hover:bg-cyan-500/20"
|
|
25
31
|
},
|
|
26
32
|
size: {
|
|
27
33
|
default: "h-10 px-4 py-2",
|
|
28
34
|
sm: "h-9 rounded-md px-3",
|
|
29
35
|
lg: "h-11 rounded-md px-8",
|
|
30
|
-
icon: "h-10 w-10"
|
|
36
|
+
icon: "h-10 w-10",
|
|
37
|
+
// Extra sizes for dashboard use
|
|
38
|
+
xs: "h-7 rounded-md px-2 text-[10px] font-bold uppercase tracking-wider"
|
|
31
39
|
}
|
|
32
40
|
},
|
|
33
41
|
defaultVariants: {
|
|
@@ -102,6 +110,32 @@ var CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
102
110
|
}
|
|
103
111
|
));
|
|
104
112
|
CardFooter.displayName = "CardFooter";
|
|
113
|
+
var GlassCard = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
ref,
|
|
117
|
+
className: cn(
|
|
118
|
+
"rounded-2xl border border-indigo-500/20 bg-slate-900/40 backdrop-blur-md shadow-xl transition-all hover:border-indigo-500/30",
|
|
119
|
+
className
|
|
120
|
+
),
|
|
121
|
+
...props
|
|
122
|
+
}
|
|
123
|
+
));
|
|
124
|
+
GlassCard.displayName = "GlassCard";
|
|
125
|
+
var GlassCardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
className: cn(
|
|
130
|
+
"flex flex-col space-y-1.5 p-6 border-b border-indigo-500/10",
|
|
131
|
+
className
|
|
132
|
+
),
|
|
133
|
+
...props
|
|
134
|
+
}
|
|
135
|
+
));
|
|
136
|
+
GlassCardHeader.displayName = "GlassCardHeader";
|
|
137
|
+
var GlassCardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6", className), ...props }));
|
|
138
|
+
GlassCardContent.displayName = "GlassCardContent";
|
|
105
139
|
var Input = React2.forwardRef(
|
|
106
140
|
({ className, type, ...props }, ref) => {
|
|
107
141
|
return /* @__PURE__ */ jsx(
|
|
@@ -145,6 +179,482 @@ var badgeVariants = cva(
|
|
|
145
179
|
function Badge({ className, variant, ...props }) {
|
|
146
180
|
return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
147
181
|
}
|
|
182
|
+
function Modal({
|
|
183
|
+
isOpen,
|
|
184
|
+
onClose,
|
|
185
|
+
children,
|
|
186
|
+
maxWidth = "max-w-4xl",
|
|
187
|
+
showClose = true,
|
|
188
|
+
variant = "glass"
|
|
189
|
+
}) {
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
if (isOpen) {
|
|
192
|
+
document.body.style.overflow = "hidden";
|
|
193
|
+
} else {
|
|
194
|
+
document.body.style.overflow = "unset";
|
|
195
|
+
}
|
|
196
|
+
return () => {
|
|
197
|
+
document.body.style.overflow = "unset";
|
|
198
|
+
};
|
|
199
|
+
}, [isOpen]);
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
const handleEsc = (e) => {
|
|
202
|
+
if (e.key === "Escape") onClose();
|
|
203
|
+
};
|
|
204
|
+
window.addEventListener("keydown", handleEsc);
|
|
205
|
+
return () => window.removeEventListener("keydown", handleEsc);
|
|
206
|
+
}, [onClose]);
|
|
207
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
|
|
208
|
+
/* @__PURE__ */ jsx(
|
|
209
|
+
motion.div,
|
|
210
|
+
{
|
|
211
|
+
initial: { opacity: 0 },
|
|
212
|
+
animate: { opacity: 1 },
|
|
213
|
+
exit: { opacity: 0 },
|
|
214
|
+
onClick: onClose,
|
|
215
|
+
className: "absolute inset-0 bg-slate-950/60 backdrop-blur-md"
|
|
216
|
+
}
|
|
217
|
+
),
|
|
218
|
+
/* @__PURE__ */ jsxs(
|
|
219
|
+
motion.div,
|
|
220
|
+
{
|
|
221
|
+
initial: { opacity: 0, scale: 0.95, y: 20 },
|
|
222
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
223
|
+
exit: { opacity: 0, scale: 0.95, y: 20 },
|
|
224
|
+
className: cn(
|
|
225
|
+
"relative w-full max-h-[90vh] overflow-y-auto shadow-2xl transition-all",
|
|
226
|
+
maxWidth,
|
|
227
|
+
variant === "glass" ? "bg-slate-900/90 backdrop-blur-xl rounded-3xl border border-indigo-500/30" : "bg-white rounded-3xl",
|
|
228
|
+
"scrollbar-thin scrollbar-thumb-slate-700"
|
|
229
|
+
),
|
|
230
|
+
children: [
|
|
231
|
+
showClose && /* @__PURE__ */ jsx(
|
|
232
|
+
"button",
|
|
233
|
+
{
|
|
234
|
+
onClick: onClose,
|
|
235
|
+
className: cn(
|
|
236
|
+
"absolute top-6 right-6 p-2 rounded-full transition-colors z-50",
|
|
237
|
+
variant === "glass" ? "text-slate-400 hover:text-white hover:bg-slate-800" : "bg-white/80 backdrop-blur-sm text-slate-500 hover:bg-slate-100"
|
|
238
|
+
),
|
|
239
|
+
"aria-label": "Close modal",
|
|
240
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-6 h-6" })
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
/* @__PURE__ */ jsx("div", { className: "p-2 sm:p-4", children })
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
] }) });
|
|
248
|
+
}
|
|
249
|
+
function RocketIcon({
|
|
250
|
+
className = "w-6 h-6",
|
|
251
|
+
...props
|
|
252
|
+
}) {
|
|
253
|
+
return /* @__PURE__ */ jsxs(
|
|
254
|
+
"svg",
|
|
255
|
+
{
|
|
256
|
+
viewBox: "0 0 24 24",
|
|
257
|
+
fill: "none",
|
|
258
|
+
stroke: "currentColor",
|
|
259
|
+
className,
|
|
260
|
+
...props,
|
|
261
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ jsx(
|
|
264
|
+
"path",
|
|
265
|
+
{
|
|
266
|
+
d: "M12 2c1.5 0 3 1 3 1s1.2 1.8 1.2 4.2c0 2.4-1.2 5-3.6 7.4-2.4 2.4-5 3.6-7.4 3.6C3.8 18.2 2 17 2 17S3 15.5 3 14c0-2.1 1.5-3.6 1.5-3.6S7.5 9 9 9c2.4 0 3-7 3-7z",
|
|
267
|
+
strokeWidth: "0",
|
|
268
|
+
fill: "currentColor"
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
"path",
|
|
273
|
+
{
|
|
274
|
+
d: "M14 10c.8.8 2 2 3 3",
|
|
275
|
+
strokeWidth: "1.5",
|
|
276
|
+
strokeLinecap: "round",
|
|
277
|
+
strokeLinejoin: "round"
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
function ChartIcon({
|
|
285
|
+
className = "w-6 h-6",
|
|
286
|
+
...props
|
|
287
|
+
}) {
|
|
288
|
+
return /* @__PURE__ */ jsxs(
|
|
289
|
+
"svg",
|
|
290
|
+
{
|
|
291
|
+
viewBox: "0 0 24 24",
|
|
292
|
+
fill: "none",
|
|
293
|
+
stroke: "currentColor",
|
|
294
|
+
className,
|
|
295
|
+
...props,
|
|
296
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
297
|
+
children: [
|
|
298
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", strokeWidth: "1.2" }),
|
|
299
|
+
/* @__PURE__ */ jsx("rect", { x: "7", y: "11", width: "2", height: "6", fill: "currentColor" }),
|
|
300
|
+
/* @__PURE__ */ jsx("rect", { x: "11", y: "8", width: "2", height: "9", fill: "currentColor" }),
|
|
301
|
+
/* @__PURE__ */ jsx("rect", { x: "15", y: "5", width: "2", height: "12", fill: "currentColor" })
|
|
302
|
+
]
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
function TargetIcon({
|
|
307
|
+
className = "w-6 h-6",
|
|
308
|
+
...props
|
|
309
|
+
}) {
|
|
310
|
+
return /* @__PURE__ */ jsxs(
|
|
311
|
+
"svg",
|
|
312
|
+
{
|
|
313
|
+
viewBox: "0 0 24 24",
|
|
314
|
+
fill: "none",
|
|
315
|
+
stroke: "currentColor",
|
|
316
|
+
className,
|
|
317
|
+
...props,
|
|
318
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", strokeWidth: "1.2" }),
|
|
321
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "5", fill: "currentColor" }),
|
|
322
|
+
/* @__PURE__ */ jsx(
|
|
323
|
+
"path",
|
|
324
|
+
{
|
|
325
|
+
d: "M22 12h-3M5 12H2M12 2v3M12 19v3",
|
|
326
|
+
strokeWidth: "1.2",
|
|
327
|
+
strokeLinecap: "round"
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
function RobotIcon({
|
|
335
|
+
className = "w-6 h-6",
|
|
336
|
+
...props
|
|
337
|
+
}) {
|
|
338
|
+
return /* @__PURE__ */ jsxs(
|
|
339
|
+
"svg",
|
|
340
|
+
{
|
|
341
|
+
viewBox: "0 0 24 24",
|
|
342
|
+
fill: "none",
|
|
343
|
+
stroke: "currentColor",
|
|
344
|
+
className,
|
|
345
|
+
...props,
|
|
346
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
347
|
+
children: [
|
|
348
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "7", width: "18", height: "11", rx: "2", strokeWidth: "1.2" }),
|
|
349
|
+
/* @__PURE__ */ jsx("rect", { x: "7", y: "10", width: "2", height: "2", fill: "currentColor" }),
|
|
350
|
+
/* @__PURE__ */ jsx("rect", { x: "15", y: "10", width: "2", height: "2", fill: "currentColor" }),
|
|
351
|
+
/* @__PURE__ */ jsx("path", { d: "M9 3v2M15 3v2", strokeWidth: "1.2", strokeLinecap: "round" })
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
function FileIcon({
|
|
357
|
+
className = "w-6 h-6",
|
|
358
|
+
...props
|
|
359
|
+
}) {
|
|
360
|
+
return /* @__PURE__ */ jsxs(
|
|
361
|
+
"svg",
|
|
362
|
+
{
|
|
363
|
+
viewBox: "0 0 24 24",
|
|
364
|
+
fill: "none",
|
|
365
|
+
stroke: "currentColor",
|
|
366
|
+
strokeWidth: "2",
|
|
367
|
+
strokeLinecap: "round",
|
|
368
|
+
strokeLinejoin: "round",
|
|
369
|
+
className,
|
|
370
|
+
...props,
|
|
371
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
372
|
+
children: [
|
|
373
|
+
/* @__PURE__ */ jsx("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" }),
|
|
374
|
+
/* @__PURE__ */ jsx("polyline", { points: "14 2 14 8 20 8" })
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
function ShieldIcon({
|
|
380
|
+
className = "w-6 h-6",
|
|
381
|
+
...props
|
|
382
|
+
}) {
|
|
383
|
+
return /* @__PURE__ */ jsx(
|
|
384
|
+
"svg",
|
|
385
|
+
{
|
|
386
|
+
viewBox: "0 0 24 24",
|
|
387
|
+
fill: "none",
|
|
388
|
+
stroke: "currentColor",
|
|
389
|
+
strokeWidth: "2",
|
|
390
|
+
strokeLinecap: "round",
|
|
391
|
+
strokeLinejoin: "round",
|
|
392
|
+
className,
|
|
393
|
+
...props,
|
|
394
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
395
|
+
children: /* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" })
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
function TrendingUpIcon({
|
|
400
|
+
className = "w-6 h-6",
|
|
401
|
+
...props
|
|
402
|
+
}) {
|
|
403
|
+
return /* @__PURE__ */ jsxs(
|
|
404
|
+
"svg",
|
|
405
|
+
{
|
|
406
|
+
viewBox: "0 0 24 24",
|
|
407
|
+
fill: "none",
|
|
408
|
+
stroke: "currentColor",
|
|
409
|
+
strokeWidth: "2",
|
|
410
|
+
strokeLinecap: "round",
|
|
411
|
+
strokeLinejoin: "round",
|
|
412
|
+
className,
|
|
413
|
+
...props,
|
|
414
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx("polyline", { points: "23 6 13.5 15.5 8.5 10.5 1 18" }),
|
|
417
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 6 23 6 23 12" })
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
function TrashIcon({
|
|
423
|
+
className = "w-6 h-6",
|
|
424
|
+
...props
|
|
425
|
+
}) {
|
|
426
|
+
return /* @__PURE__ */ jsxs(
|
|
427
|
+
"svg",
|
|
428
|
+
{
|
|
429
|
+
viewBox: "0 0 24 24",
|
|
430
|
+
fill: "none",
|
|
431
|
+
stroke: "currentColor",
|
|
432
|
+
strokeWidth: "2",
|
|
433
|
+
strokeLinecap: "round",
|
|
434
|
+
strokeLinejoin: "round",
|
|
435
|
+
className,
|
|
436
|
+
...props,
|
|
437
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
440
|
+
/* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
441
|
+
]
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
function PlayIcon({
|
|
446
|
+
className = "w-6 h-6",
|
|
447
|
+
...props
|
|
448
|
+
}) {
|
|
449
|
+
return /* @__PURE__ */ jsx(
|
|
450
|
+
"svg",
|
|
451
|
+
{
|
|
452
|
+
viewBox: "0 0 24 24",
|
|
453
|
+
fill: "none",
|
|
454
|
+
stroke: "currentColor",
|
|
455
|
+
strokeWidth: "2",
|
|
456
|
+
strokeLinecap: "round",
|
|
457
|
+
strokeLinejoin: "round",
|
|
458
|
+
className,
|
|
459
|
+
...props,
|
|
460
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
461
|
+
children: /* @__PURE__ */ jsx("polygon", { points: "5 3 19 12 5 21 5 3" })
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
function UploadIcon({
|
|
466
|
+
className = "w-6 h-6",
|
|
467
|
+
...props
|
|
468
|
+
}) {
|
|
469
|
+
return /* @__PURE__ */ jsxs(
|
|
470
|
+
"svg",
|
|
471
|
+
{
|
|
472
|
+
viewBox: "0 0 24 24",
|
|
473
|
+
fill: "none",
|
|
474
|
+
stroke: "currentColor",
|
|
475
|
+
strokeWidth: "2",
|
|
476
|
+
strokeLinecap: "round",
|
|
477
|
+
strokeLinejoin: "round",
|
|
478
|
+
className,
|
|
479
|
+
...props,
|
|
480
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
481
|
+
children: [
|
|
482
|
+
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v4" }),
|
|
483
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 8 12 3 7 8" }),
|
|
484
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
|
|
485
|
+
]
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
function AlertCircleIcon({
|
|
490
|
+
className = "w-6 h-6",
|
|
491
|
+
...props
|
|
492
|
+
}) {
|
|
493
|
+
return /* @__PURE__ */ jsxs(
|
|
494
|
+
"svg",
|
|
495
|
+
{
|
|
496
|
+
viewBox: "0 0 24 24",
|
|
497
|
+
fill: "none",
|
|
498
|
+
stroke: "currentColor",
|
|
499
|
+
strokeWidth: "2",
|
|
500
|
+
strokeLinecap: "round",
|
|
501
|
+
strokeLinejoin: "round",
|
|
502
|
+
className,
|
|
503
|
+
...props,
|
|
504
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
505
|
+
children: [
|
|
506
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
507
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
|
|
508
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
|
|
509
|
+
]
|
|
510
|
+
}
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
function InfoIcon({
|
|
514
|
+
className = "w-6 h-6",
|
|
515
|
+
...props
|
|
516
|
+
}) {
|
|
517
|
+
return /* @__PURE__ */ jsxs(
|
|
518
|
+
"svg",
|
|
519
|
+
{
|
|
520
|
+
viewBox: "0 0 24 24",
|
|
521
|
+
fill: "none",
|
|
522
|
+
stroke: "currentColor",
|
|
523
|
+
strokeWidth: "2",
|
|
524
|
+
strokeLinecap: "round",
|
|
525
|
+
strokeLinejoin: "round",
|
|
526
|
+
className,
|
|
527
|
+
...props,
|
|
528
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
531
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
532
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
function BrainIcon({
|
|
538
|
+
className = "w-6 h-6",
|
|
539
|
+
...props
|
|
540
|
+
}) {
|
|
541
|
+
return /* @__PURE__ */ jsxs(
|
|
542
|
+
"svg",
|
|
543
|
+
{
|
|
544
|
+
viewBox: "0 0 24 24",
|
|
545
|
+
fill: "none",
|
|
546
|
+
stroke: "currentColor",
|
|
547
|
+
strokeWidth: "2",
|
|
548
|
+
strokeLinecap: "round",
|
|
549
|
+
strokeLinejoin: "round",
|
|
550
|
+
className,
|
|
551
|
+
...props,
|
|
552
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
553
|
+
children: [
|
|
554
|
+
/* @__PURE__ */ jsx("path", { d: "M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.74-3.41A2.5 2.5 0 0 1 2 14c0-1.5 1-2 1-2s-1-.5-1-2a2.5 2.5 0 0 1 2.3-2.48A2.5 2.5 0 0 1 7 5.5a2.5 2.5 0 0 1 2.5-3.5z" }),
|
|
555
|
+
/* @__PURE__ */ jsx("path", { d: "M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.74-3.41A2.5 2.5 0 0 0 22 14c0-1.5-1-2-1-2s1-.5 1-2a2.5 2.5 0 0 0-2.3-2.48A2.5 2.5 0 0 0 17 5.5a2.5 2.5 0 0 0-2.5-3.5z" })
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
);
|
|
559
|
+
}
|
|
560
|
+
function TerminalIcon({
|
|
561
|
+
className = "w-6 h-6",
|
|
562
|
+
...props
|
|
563
|
+
}) {
|
|
564
|
+
return /* @__PURE__ */ jsxs(
|
|
565
|
+
"svg",
|
|
566
|
+
{
|
|
567
|
+
viewBox: "0 0 24 24",
|
|
568
|
+
fill: "none",
|
|
569
|
+
stroke: "currentColor",
|
|
570
|
+
strokeWidth: "2",
|
|
571
|
+
strokeLinecap: "round",
|
|
572
|
+
strokeLinejoin: "round",
|
|
573
|
+
className,
|
|
574
|
+
...props,
|
|
575
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
576
|
+
children: [
|
|
577
|
+
/* @__PURE__ */ jsx("polyline", { points: "4 17 10 11 4 5" }),
|
|
578
|
+
/* @__PURE__ */ jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
|
|
579
|
+
]
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
function CommandLineIcon(props) {
|
|
584
|
+
return /* @__PURE__ */ jsx(TerminalIcon, { ...props });
|
|
585
|
+
}
|
|
586
|
+
function SettingsIcon({
|
|
587
|
+
className = "w-6 h-6",
|
|
588
|
+
...props
|
|
589
|
+
}) {
|
|
590
|
+
return /* @__PURE__ */ jsxs(
|
|
591
|
+
"svg",
|
|
592
|
+
{
|
|
593
|
+
viewBox: "0 0 24 24",
|
|
594
|
+
fill: "none",
|
|
595
|
+
stroke: "currentColor",
|
|
596
|
+
strokeWidth: "2",
|
|
597
|
+
strokeLinecap: "round",
|
|
598
|
+
strokeLinejoin: "round",
|
|
599
|
+
className,
|
|
600
|
+
...props,
|
|
601
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ jsx("path", { d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.1a2 2 0 0 1-1-1.72v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" }),
|
|
604
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
);
|
|
608
|
+
}
|
|
609
|
+
function SaveIcon({
|
|
610
|
+
className = "w-6 h-6",
|
|
611
|
+
...props
|
|
612
|
+
}) {
|
|
613
|
+
return /* @__PURE__ */ jsxs(
|
|
614
|
+
"svg",
|
|
615
|
+
{
|
|
616
|
+
viewBox: "0 0 24 24",
|
|
617
|
+
fill: "none",
|
|
618
|
+
stroke: "currentColor",
|
|
619
|
+
strokeWidth: "2",
|
|
620
|
+
strokeLinecap: "round",
|
|
621
|
+
strokeLinejoin: "round",
|
|
622
|
+
className,
|
|
623
|
+
...props,
|
|
624
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ jsx("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
|
|
627
|
+
/* @__PURE__ */ jsx("polyline", { points: "17 21 17 13 7 13 7 21" }),
|
|
628
|
+
/* @__PURE__ */ jsx("polyline", { points: "7 3 7 8 15 8" })
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
function RefreshCwIcon({
|
|
634
|
+
className = "w-6 h-6",
|
|
635
|
+
...props
|
|
636
|
+
}) {
|
|
637
|
+
return /* @__PURE__ */ jsxs(
|
|
638
|
+
"svg",
|
|
639
|
+
{
|
|
640
|
+
viewBox: "0 0 24 24",
|
|
641
|
+
fill: "none",
|
|
642
|
+
stroke: "currentColor",
|
|
643
|
+
strokeWidth: "2",
|
|
644
|
+
strokeLinecap: "round",
|
|
645
|
+
strokeLinejoin: "round",
|
|
646
|
+
className,
|
|
647
|
+
...props,
|
|
648
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
649
|
+
children: [
|
|
650
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
651
|
+
/* @__PURE__ */ jsx("path", { d: "M21 3v5h-5" }),
|
|
652
|
+
/* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
653
|
+
/* @__PURE__ */ jsx("path", { d: "M3 21v-5h5" })
|
|
654
|
+
]
|
|
655
|
+
}
|
|
656
|
+
);
|
|
657
|
+
}
|
|
148
658
|
var Container = React2.forwardRef(
|
|
149
659
|
({ className, size = "lg", ...props }, ref) => {
|
|
150
660
|
return /* @__PURE__ */ jsx(
|
|
@@ -449,10 +959,9 @@ function dedentCode(code) {
|
|
|
449
959
|
const m = line.match(/^\s*/)?.[0].length ?? 0;
|
|
450
960
|
return Math.min(min, m);
|
|
451
961
|
}, Infinity);
|
|
452
|
-
|
|
962
|
+
return minIndent === Infinity || minIndent === 0 ? relevantLines.join("\n") : relevantLines.map(
|
|
453
963
|
(l) => l.startsWith(" ".repeat(minIndent)) ? l.slice(minIndent) : l
|
|
454
964
|
).join("\n");
|
|
455
|
-
return dedented;
|
|
456
965
|
}
|
|
457
966
|
function CopyButton({ code }) {
|
|
458
967
|
const [copied, setCopied] = useState(false);
|
|
@@ -478,43 +987,27 @@ function CopyButton({ code }) {
|
|
|
478
987
|
"button",
|
|
479
988
|
{
|
|
480
989
|
onClick: handleCopy,
|
|
481
|
-
className: "
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
"svg",
|
|
990
|
+
className: "flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] font-bold uppercase tracking-wider text-slate-400 hover:bg-slate-700/50 hover:text-cyan-400 transition-all",
|
|
991
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: copied ? /* @__PURE__ */ jsx(
|
|
992
|
+
motion.span,
|
|
485
993
|
{
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
{
|
|
494
|
-
strokeLinecap: "round",
|
|
495
|
-
strokeLinejoin: "round",
|
|
496
|
-
d: "M4.5 12.75l6 6 9-13.5"
|
|
497
|
-
}
|
|
498
|
-
)
|
|
499
|
-
}
|
|
994
|
+
initial: { opacity: 0, y: 5 },
|
|
995
|
+
animate: { opacity: 1, y: 0 },
|
|
996
|
+
exit: { opacity: 0, y: -5 },
|
|
997
|
+
className: "text-cyan-400",
|
|
998
|
+
children: "Copied!"
|
|
999
|
+
},
|
|
1000
|
+
"copied"
|
|
500
1001
|
) : /* @__PURE__ */ jsx(
|
|
501
|
-
|
|
1002
|
+
motion.span,
|
|
502
1003
|
{
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
{
|
|
511
|
-
strokeLinecap: "round",
|
|
512
|
-
strokeLinejoin: "round",
|
|
513
|
-
d: "M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"
|
|
514
|
-
}
|
|
515
|
-
)
|
|
516
|
-
}
|
|
517
|
-
)
|
|
1004
|
+
initial: { opacity: 0, y: 5 },
|
|
1005
|
+
animate: { opacity: 1, y: 0 },
|
|
1006
|
+
exit: { opacity: 0, y: -5 },
|
|
1007
|
+
children: "Copy"
|
|
1008
|
+
},
|
|
1009
|
+
"copy"
|
|
1010
|
+
) })
|
|
518
1011
|
}
|
|
519
1012
|
);
|
|
520
1013
|
}
|
|
@@ -523,12 +1016,11 @@ function CodeBlock({
|
|
|
523
1016
|
language = "typescript",
|
|
524
1017
|
showCopy = true,
|
|
525
1018
|
showHeader = true,
|
|
526
|
-
className = ""
|
|
1019
|
+
className = "",
|
|
1020
|
+
variant = "glass"
|
|
527
1021
|
}) {
|
|
528
1022
|
const codeString = useMemo(() => {
|
|
529
|
-
if (typeof children === "string")
|
|
530
|
-
return dedentCode(children);
|
|
531
|
-
}
|
|
1023
|
+
if (typeof children === "string") return dedentCode(children);
|
|
532
1024
|
try {
|
|
533
1025
|
const raw = React2__default.Children.toArray(children).map(
|
|
534
1026
|
(c) => typeof c === "string" ? c : typeof c === "number" ? String(c) : ""
|
|
@@ -541,20 +1033,33 @@ function CodeBlock({
|
|
|
541
1033
|
return /* @__PURE__ */ jsxs(
|
|
542
1034
|
"div",
|
|
543
1035
|
{
|
|
544
|
-
className:
|
|
1036
|
+
className: cn(
|
|
1037
|
+
"group relative my-6 overflow-hidden rounded-2xl border transition-all",
|
|
1038
|
+
variant === "glass" ? "border-indigo-500/20 bg-slate-950/40 backdrop-blur-md shadow-2xl" : "border-slate-700 bg-slate-900 shadow-lg",
|
|
1039
|
+
className
|
|
1040
|
+
),
|
|
545
1041
|
children: [
|
|
546
|
-
showHeader && /* @__PURE__ */ jsxs(
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
1042
|
+
showHeader && /* @__PURE__ */ jsxs(
|
|
1043
|
+
"div",
|
|
1044
|
+
{
|
|
1045
|
+
className: cn(
|
|
1046
|
+
"flex items-center justify-between px-4 py-2 border-b",
|
|
1047
|
+
variant === "glass" ? "border-indigo-500/10 bg-slate-900/20" : "border-slate-800 bg-slate-800/50"
|
|
1048
|
+
),
|
|
1049
|
+
children: [
|
|
1050
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1051
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1.5", children: [
|
|
1052
|
+
/* @__PURE__ */ jsx("div", { className: "h-2.5 w-2.5 rounded-full bg-red-500/20 border border-red-500/40" }),
|
|
1053
|
+
/* @__PURE__ */ jsx("div", { className: "h-2.5 w-2.5 rounded-full bg-amber-500/20 border border-amber-500/40" }),
|
|
1054
|
+
/* @__PURE__ */ jsx("div", { className: "h-2.5 w-2.5 rounded-full bg-emerald-500/20 border border-emerald-500/40" })
|
|
1055
|
+
] }),
|
|
1056
|
+
/* @__PURE__ */ jsx("span", { className: "ml-2 text-[10px] font-bold uppercase tracking-widest text-slate-500 font-mono", children: language })
|
|
1057
|
+
] }),
|
|
1058
|
+
showCopy && /* @__PURE__ */ jsx(CopyButton, { code: codeString })
|
|
1059
|
+
]
|
|
1060
|
+
}
|
|
1061
|
+
),
|
|
1062
|
+
/* @__PURE__ */ jsx("pre", { className: "overflow-x-auto p-4 text-sm leading-relaxed scrollbar-thin scrollbar-thumb-slate-700", children: /* @__PURE__ */ jsx("code", { className: "font-mono block whitespace-pre text-slate-300", children: codeString }) })
|
|
558
1063
|
]
|
|
559
1064
|
}
|
|
560
1065
|
);
|
|
@@ -566,56 +1071,339 @@ function InlineCode({
|
|
|
566
1071
|
return /* @__PURE__ */ jsx(
|
|
567
1072
|
"code",
|
|
568
1073
|
{
|
|
569
|
-
className:
|
|
1074
|
+
className: cn(
|
|
1075
|
+
"rounded-md bg-slate-800/50 border border-slate-700/50 px-1.5 py-0.5 text-xs font-mono text-cyan-400",
|
|
1076
|
+
className
|
|
1077
|
+
),
|
|
570
1078
|
children
|
|
571
1079
|
}
|
|
572
1080
|
);
|
|
573
1081
|
}
|
|
574
|
-
|
|
575
|
-
"
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
1082
|
+
function Breadcrumb({ items, className }) {
|
|
1083
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", className: cn("mb-8", className), children: /* @__PURE__ */ jsx("ol", { className: "flex items-center gap-2 text-sm", children: items.map((item, index) => /* @__PURE__ */ jsxs(
|
|
1084
|
+
motion.li,
|
|
1085
|
+
{
|
|
1086
|
+
initial: { opacity: 0, x: -10 },
|
|
1087
|
+
animate: { opacity: 1, x: 0 },
|
|
1088
|
+
transition: { delay: index * 0.1 },
|
|
1089
|
+
className: "flex items-center gap-2",
|
|
1090
|
+
children: [
|
|
1091
|
+
index > 0 && /* @__PURE__ */ jsx("span", { className: "text-slate-600", children: "/" }),
|
|
1092
|
+
index === items.length - 1 ? /* @__PURE__ */ jsx("span", { className: "text-cyan-400 font-medium", children: item.label }) : /* @__PURE__ */ jsx(
|
|
1093
|
+
"a",
|
|
1094
|
+
{
|
|
1095
|
+
href: item.href,
|
|
1096
|
+
className: "text-slate-400 hover:text-white transition-colors",
|
|
1097
|
+
children: item.label
|
|
1098
|
+
}
|
|
1099
|
+
)
|
|
1100
|
+
]
|
|
1101
|
+
},
|
|
1102
|
+
item.href
|
|
1103
|
+
)) }) });
|
|
1104
|
+
}
|
|
1105
|
+
function NavItemComponent({
|
|
1106
|
+
href,
|
|
1107
|
+
label,
|
|
1108
|
+
icon: Icon,
|
|
1109
|
+
isActive,
|
|
1110
|
+
onClick,
|
|
1111
|
+
LinkComponent = "a"
|
|
1112
|
+
}) {
|
|
1113
|
+
const Component = LinkComponent;
|
|
1114
|
+
return /* @__PURE__ */ jsx(Component, { href, onClick, className: "block group", children: /* @__PURE__ */ jsxs(
|
|
1115
|
+
"div",
|
|
1116
|
+
{
|
|
1117
|
+
className: cn(
|
|
1118
|
+
"flex items-center gap-3 px-4 py-3 rounded-xl transition-all",
|
|
1119
|
+
isActive ? "bg-cyan-500/10 text-cyan-400 border border-cyan-500/20" : "text-slate-400 hover:text-white hover:bg-slate-800/50 border border-transparent"
|
|
1120
|
+
),
|
|
1121
|
+
children: [
|
|
1122
|
+
/* @__PURE__ */ jsx(
|
|
1123
|
+
Icon,
|
|
1124
|
+
{
|
|
1125
|
+
className: cn(
|
|
1126
|
+
"w-5 h-5",
|
|
1127
|
+
isActive ? "text-cyan-400" : "text-slate-500 group-hover:text-slate-300"
|
|
1128
|
+
)
|
|
1129
|
+
}
|
|
1130
|
+
),
|
|
1131
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold tracking-tight", children: label }),
|
|
1132
|
+
isActive && /* @__PURE__ */ jsx(
|
|
1133
|
+
motion.div,
|
|
1134
|
+
{
|
|
1135
|
+
layoutId: "sidebar-active",
|
|
1136
|
+
className: "ml-auto w-1.5 h-1.5 rounded-full bg-cyan-400 shadow-[0_0_8px_rgba(34,211,238,0.8)]"
|
|
1137
|
+
}
|
|
1138
|
+
)
|
|
1139
|
+
]
|
|
1140
|
+
}
|
|
1141
|
+
) });
|
|
1142
|
+
}
|
|
1143
|
+
function UserMenu({
|
|
1144
|
+
user,
|
|
1145
|
+
teams = [],
|
|
1146
|
+
currentTeamId,
|
|
1147
|
+
onSwitchTeam,
|
|
1148
|
+
onSignOut
|
|
1149
|
+
}) {
|
|
1150
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
1151
|
+
const dropdownRef = useRef(null);
|
|
1152
|
+
useEffect(() => {
|
|
1153
|
+
function handleClickOutside(event) {
|
|
1154
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1155
|
+
setIsOpen(false);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1159
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1160
|
+
}, []);
|
|
1161
|
+
const currentWorkspaceName = currentTeamId === "personal" ? "Personal Workspace" : teams.find((t) => t.teamId === currentTeamId)?.team.name || "Team Workspace";
|
|
1162
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", ref: dropdownRef, children: [
|
|
1163
|
+
/* @__PURE__ */ jsxs(
|
|
1164
|
+
"button",
|
|
584
1165
|
{
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
1166
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1167
|
+
className: "flex items-center gap-2 p-1.5 rounded-xl hover:bg-slate-800/50 transition-all border border-transparent hover:border-slate-700/50",
|
|
1168
|
+
children: [
|
|
1169
|
+
user.image ? /* @__PURE__ */ jsx(
|
|
1170
|
+
"img",
|
|
1171
|
+
{
|
|
1172
|
+
src: user.image,
|
|
1173
|
+
alt: user.name || "User",
|
|
1174
|
+
className: "w-8 h-8 rounded-lg border border-cyan-500/30"
|
|
1175
|
+
}
|
|
1176
|
+
) : /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-lg bg-indigo-600 flex items-center justify-center text-xs font-bold text-white", children: user.name?.[0] || user.email?.[0] }),
|
|
1177
|
+
/* @__PURE__ */ jsxs("div", { className: "text-left hidden sm:block", children: [
|
|
1178
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-white leading-none mb-0.5", children: user.name || user.email?.split("@")[0] }),
|
|
1179
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-slate-400 leading-none truncate max-w-[100px]", children: currentWorkspaceName })
|
|
1180
|
+
] }),
|
|
1181
|
+
/* @__PURE__ */ jsx(
|
|
1182
|
+
"svg",
|
|
1183
|
+
{
|
|
1184
|
+
className: cn(
|
|
1185
|
+
"w-4 h-4 text-slate-500 transition-transform",
|
|
1186
|
+
isOpen && "rotate-180"
|
|
1187
|
+
),
|
|
1188
|
+
fill: "none",
|
|
1189
|
+
viewBox: "0 0 24 24",
|
|
1190
|
+
stroke: "currentColor",
|
|
1191
|
+
children: /* @__PURE__ */ jsx(
|
|
1192
|
+
"path",
|
|
1193
|
+
{
|
|
1194
|
+
strokeLinecap: "round",
|
|
1195
|
+
strokeLinejoin: "round",
|
|
1196
|
+
strokeWidth: 2,
|
|
1197
|
+
d: "M19 9l-7 7-7-7"
|
|
1198
|
+
}
|
|
1199
|
+
)
|
|
1200
|
+
}
|
|
1201
|
+
)
|
|
1202
|
+
]
|
|
588
1203
|
}
|
|
589
|
-
)
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
1204
|
+
),
|
|
1205
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(
|
|
1206
|
+
motion.div,
|
|
1207
|
+
{
|
|
1208
|
+
initial: { opacity: 0, y: 10, scale: 0.95 },
|
|
1209
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
1210
|
+
exit: { opacity: 0, y: 10, scale: 0.95 },
|
|
1211
|
+
className: "absolute right-0 mt-2 w-64 bg-slate-900 border border-slate-700 rounded-2xl shadow-2xl z-50 overflow-hidden",
|
|
1212
|
+
children: [
|
|
1213
|
+
/* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-slate-800", children: [
|
|
1214
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-bold text-white", children: user.name }),
|
|
1215
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-slate-400 truncate", children: user.email })
|
|
1216
|
+
] }),
|
|
1217
|
+
/* @__PURE__ */ jsxs("div", { className: "p-2 border-b border-slate-800", children: [
|
|
1218
|
+
/* @__PURE__ */ jsx("p", { className: "px-3 py-1 text-[10px] font-black text-slate-500 uppercase tracking-widest mb-1", children: "Workspaces" }),
|
|
1219
|
+
/* @__PURE__ */ jsxs(
|
|
1220
|
+
"button",
|
|
1221
|
+
{
|
|
1222
|
+
onClick: () => {
|
|
1223
|
+
onSwitchTeam?.("personal");
|
|
1224
|
+
setIsOpen(false);
|
|
1225
|
+
},
|
|
1226
|
+
className: cn(
|
|
1227
|
+
"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",
|
|
1228
|
+
currentTeamId === "personal" ? "bg-cyan-500/10 text-cyan-400" : "text-slate-400 hover:bg-slate-800 hover:text-white"
|
|
1229
|
+
),
|
|
1230
|
+
children: [
|
|
1231
|
+
/* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded bg-slate-700 flex items-center justify-center text-[10px] font-bold", children: "P" }),
|
|
1232
|
+
"Personal"
|
|
1233
|
+
]
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1236
|
+
teams.map((t) => /* @__PURE__ */ jsxs(
|
|
1237
|
+
"button",
|
|
1238
|
+
{
|
|
1239
|
+
onClick: () => {
|
|
1240
|
+
onSwitchTeam?.(t.teamId);
|
|
1241
|
+
setIsOpen(false);
|
|
1242
|
+
},
|
|
1243
|
+
className: cn(
|
|
1244
|
+
"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",
|
|
1245
|
+
currentTeamId === t.teamId ? "bg-purple-500/10 text-purple-400" : "text-slate-400 hover:bg-slate-800 hover:text-white"
|
|
1246
|
+
),
|
|
1247
|
+
children: [
|
|
1248
|
+
/* @__PURE__ */ jsx("div", { className: "w-5 h-5 rounded bg-purple-600 flex items-center justify-center text-[10px] font-bold", children: t.team.name[0] }),
|
|
1249
|
+
t.team.name
|
|
1250
|
+
]
|
|
1251
|
+
},
|
|
1252
|
+
t.teamId
|
|
1253
|
+
))
|
|
1254
|
+
] }),
|
|
1255
|
+
/* @__PURE__ */ jsx("div", { className: "p-2", children: /* @__PURE__ */ jsxs(
|
|
1256
|
+
"button",
|
|
605
1257
|
{
|
|
606
|
-
|
|
607
|
-
className: "text-
|
|
608
|
-
children:
|
|
1258
|
+
onClick: onSignOut,
|
|
1259
|
+
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-red-400 hover:bg-red-500/10 transition-colors",
|
|
1260
|
+
children: [
|
|
1261
|
+
/* @__PURE__ */ jsx(
|
|
1262
|
+
"svg",
|
|
1263
|
+
{
|
|
1264
|
+
className: "w-4 h-4",
|
|
1265
|
+
fill: "none",
|
|
1266
|
+
viewBox: "0 0 24 24",
|
|
1267
|
+
stroke: "currentColor",
|
|
1268
|
+
children: /* @__PURE__ */ jsx(
|
|
1269
|
+
"path",
|
|
1270
|
+
{
|
|
1271
|
+
strokeLinecap: "round",
|
|
1272
|
+
strokeLinejoin: "round",
|
|
1273
|
+
strokeWidth: 2,
|
|
1274
|
+
d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"
|
|
1275
|
+
}
|
|
1276
|
+
)
|
|
1277
|
+
}
|
|
1278
|
+
),
|
|
1279
|
+
"Sign out"
|
|
1280
|
+
]
|
|
609
1281
|
}
|
|
610
|
-
)
|
|
611
|
-
|
|
1282
|
+
) })
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
) })
|
|
1286
|
+
] });
|
|
1287
|
+
}
|
|
1288
|
+
function PlatformShell({
|
|
1289
|
+
children,
|
|
1290
|
+
user,
|
|
1291
|
+
teams = [],
|
|
1292
|
+
overallScore,
|
|
1293
|
+
activePage,
|
|
1294
|
+
pathname = "",
|
|
1295
|
+
onNavigate,
|
|
1296
|
+
onSignOut,
|
|
1297
|
+
onSwitchTeam,
|
|
1298
|
+
logoUrl = "/logo-text-transparent-dark-theme.png",
|
|
1299
|
+
navItems = [
|
|
1300
|
+
{ href: "/dashboard", label: "Dashboard", icon: RocketIcon },
|
|
1301
|
+
{ href: "/strategy", label: "Scan Strategy", icon: SettingsIcon },
|
|
1302
|
+
{ href: "/trends", label: "Trends Explorer", icon: TrendingUpIcon },
|
|
1303
|
+
{ href: "/map", label: "Codebase Map", icon: RobotIcon },
|
|
1304
|
+
{ href: "/metrics", label: "Methodology", icon: ChartIcon }
|
|
1305
|
+
],
|
|
1306
|
+
LinkComponent = "a"
|
|
1307
|
+
}) {
|
|
1308
|
+
const [currentTeamId, setCurrentTeamId] = useState(
|
|
1309
|
+
"personal"
|
|
1310
|
+
);
|
|
1311
|
+
const handleSwitchTeam = (teamId) => {
|
|
1312
|
+
setCurrentTeamId(teamId);
|
|
1313
|
+
onSwitchTeam?.(teamId);
|
|
1314
|
+
};
|
|
1315
|
+
const Sidebar = () => /* @__PURE__ */ jsx("aside", { className: "hidden lg:flex flex-col w-64 bg-slate-950/50 border-r border-slate-800 h-screen sticky top-0 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "p-6 flex flex-col h-full", children: [
|
|
1316
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center mb-10", children: /* @__PURE__ */ jsx("img", { src: logoUrl, alt: "AIReady", className: "h-9 w-auto" }) }),
|
|
1317
|
+
/* @__PURE__ */ jsxs("nav", { className: "space-y-1.5 flex-1", children: [
|
|
1318
|
+
/* @__PURE__ */ jsx("p", { className: "px-4 py-2 text-[10px] font-black text-slate-500 uppercase tracking-widest mb-2", children: "Workspace" }),
|
|
1319
|
+
navItems.map((item) => /* @__PURE__ */ jsx(
|
|
1320
|
+
NavItemComponent,
|
|
1321
|
+
{
|
|
1322
|
+
...item,
|
|
1323
|
+
LinkComponent,
|
|
1324
|
+
isActive: pathname === item.href || item.href !== "/dashboard" && pathname.startsWith(item.href),
|
|
1325
|
+
onClick: (e) => {
|
|
1326
|
+
if (onNavigate) {
|
|
1327
|
+
e.preventDefault();
|
|
1328
|
+
onNavigate(item.href);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
},
|
|
1332
|
+
item.href
|
|
1333
|
+
))
|
|
1334
|
+
] }),
|
|
1335
|
+
/* @__PURE__ */ jsx("div", { className: "mt-auto pt-6 space-y-4", children: /* @__PURE__ */ jsxs("div", { className: "p-4 rounded-2xl bg-gradient-to-br from-indigo-500/10 to-purple-500/10 border border-indigo-500/20", children: [
|
|
1336
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-white mb-1", children: "AI Insights" }),
|
|
1337
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-slate-400 leading-relaxed", children: overallScore != null ? `Your codebase is ${overallScore}% ready for AI agents.` : "Run a scan to see your AI-readiness score." })
|
|
1338
|
+
] }) })
|
|
1339
|
+
] }) });
|
|
1340
|
+
const Navbar = () => /* @__PURE__ */ jsx("header", { className: "sticky top-0 z-20 h-16 border-b border-indigo-500/10 backdrop-blur-md bg-slate-950/20 px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "h-full flex items-center justify-between", children: [
|
|
1341
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-slate-500 uppercase tracking-widest hidden sm:block", children: activePage || "Dashboard" }) }),
|
|
1342
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: user && /* @__PURE__ */ jsx(
|
|
1343
|
+
UserMenu,
|
|
1344
|
+
{
|
|
1345
|
+
user,
|
|
1346
|
+
teams,
|
|
1347
|
+
currentTeamId,
|
|
1348
|
+
onSwitchTeam: handleSwitchTeam,
|
|
1349
|
+
onSignOut
|
|
1350
|
+
}
|
|
1351
|
+
) })
|
|
1352
|
+
] }) });
|
|
1353
|
+
return /* @__PURE__ */ jsxs(
|
|
1354
|
+
"div",
|
|
1355
|
+
{
|
|
1356
|
+
className: cn(
|
|
1357
|
+
"min-h-screen bg-[#0a0a0f]",
|
|
1358
|
+
user && "flex overflow-hidden"
|
|
1359
|
+
),
|
|
1360
|
+
children: [
|
|
1361
|
+
user && /* @__PURE__ */ jsx(Sidebar, {}),
|
|
1362
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex-1 flex flex-col min-w-0", user && "h-screen"), children: [
|
|
1363
|
+
user && /* @__PURE__ */ jsx(Navbar, {}),
|
|
1364
|
+
/* @__PURE__ */ jsxs(
|
|
1365
|
+
"main",
|
|
612
1366
|
{
|
|
613
|
-
className:
|
|
614
|
-
children:
|
|
1367
|
+
className: cn("relative flex-1", user && "overflow-y-auto", "z-10"),
|
|
1368
|
+
children: [
|
|
1369
|
+
user && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1370
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 pointer-events-none -z-10 overflow-hidden", children: [
|
|
1371
|
+
/* @__PURE__ */ jsx(
|
|
1372
|
+
"div",
|
|
1373
|
+
{
|
|
1374
|
+
className: "absolute rounded-full blur-[60px] opacity-20 bg-radial-gradient from-blue-600/60 to-transparent w-96 h-96 -top-48 -right-48",
|
|
1375
|
+
style: {
|
|
1376
|
+
background: "radial-gradient(circle, rgba(59, 130, 246, 0.6), transparent)"
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
),
|
|
1380
|
+
/* @__PURE__ */ jsx(
|
|
1381
|
+
"div",
|
|
1382
|
+
{
|
|
1383
|
+
className: "absolute rounded-full blur-[60px] opacity-20 bg-radial-gradient from-purple-600/60 to-transparent w-80 h-80 bottom-0 -left-40",
|
|
1384
|
+
style: {
|
|
1385
|
+
background: "radial-gradient(circle, rgba(139, 92, 246, 0.6), transparent)"
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
)
|
|
1389
|
+
] }),
|
|
1390
|
+
/* @__PURE__ */ jsx(
|
|
1391
|
+
"div",
|
|
1392
|
+
{
|
|
1393
|
+
className: "absolute inset-0 opacity-10 -z-10",
|
|
1394
|
+
style: {
|
|
1395
|
+
backgroundImage: "linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px)",
|
|
1396
|
+
backgroundSize: "50px 50px"
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
)
|
|
1400
|
+
] }),
|
|
1401
|
+
children
|
|
1402
|
+
]
|
|
615
1403
|
}
|
|
616
1404
|
)
|
|
617
|
-
] }
|
|
618
|
-
|
|
1405
|
+
] })
|
|
1406
|
+
]
|
|
619
1407
|
}
|
|
620
1408
|
);
|
|
621
1409
|
}
|
|
@@ -741,6 +1529,127 @@ function ScoreCard({
|
|
|
741
1529
|
}
|
|
742
1530
|
);
|
|
743
1531
|
}
|
|
1532
|
+
function ScoreCircle({
|
|
1533
|
+
score,
|
|
1534
|
+
progress: customProgress,
|
|
1535
|
+
isInView = true,
|
|
1536
|
+
size = "md",
|
|
1537
|
+
showLabel = true,
|
|
1538
|
+
className
|
|
1539
|
+
}) {
|
|
1540
|
+
const progress = customProgress ?? score;
|
|
1541
|
+
const getScoreColor = () => {
|
|
1542
|
+
if (score >= 80)
|
|
1543
|
+
return { stroke: "#10b981", glow: "rgba(16, 185, 129, 0.3)" };
|
|
1544
|
+
if (score >= 60)
|
|
1545
|
+
return { stroke: "#eab308", glow: "rgba(234, 179, 8, 0.3)" };
|
|
1546
|
+
return { stroke: "#ef4444", glow: "rgba(239, 68, 68, 0.3)" };
|
|
1547
|
+
};
|
|
1548
|
+
const scoreColor2 = getScoreColor();
|
|
1549
|
+
const sizeMap = {
|
|
1550
|
+
sm: "w-32 h-32",
|
|
1551
|
+
md: "w-48 h-48",
|
|
1552
|
+
lg: "w-64 h-64",
|
|
1553
|
+
xl: "w-80 h-80"
|
|
1554
|
+
};
|
|
1555
|
+
const textMap = {
|
|
1556
|
+
sm: { score: "text-3xl", label: "text-[8px]", title: "text-sm" },
|
|
1557
|
+
md: { score: "text-5xl", label: "text-[10px]", title: "text-lg" },
|
|
1558
|
+
lg: { score: "text-6xl", label: "text-xs", title: "text-xl" },
|
|
1559
|
+
xl: { score: "text-7xl", label: "text-sm", title: "text-2xl" }
|
|
1560
|
+
};
|
|
1561
|
+
const currentSize = sizeMap[size];
|
|
1562
|
+
const currentText = textMap[size];
|
|
1563
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative", currentSize, className), children: [
|
|
1564
|
+
/* @__PURE__ */ jsx(
|
|
1565
|
+
"div",
|
|
1566
|
+
{
|
|
1567
|
+
className: "absolute inset-0 rounded-full blur-2xl opacity-50 transition-all duration-500",
|
|
1568
|
+
style: { backgroundColor: scoreColor2.glow }
|
|
1569
|
+
}
|
|
1570
|
+
),
|
|
1571
|
+
/* @__PURE__ */ jsx(
|
|
1572
|
+
"svg",
|
|
1573
|
+
{
|
|
1574
|
+
className: "w-full h-full transform -rotate-90 relative z-10",
|
|
1575
|
+
viewBox: "0 0 100 100",
|
|
1576
|
+
children: Array.from({ length: 20 }).map((_, i) => {
|
|
1577
|
+
const angle = i * 360 / 20;
|
|
1578
|
+
const startAngle = angle - 85;
|
|
1579
|
+
const radius = 42;
|
|
1580
|
+
const strokeWidth = 6;
|
|
1581
|
+
const gapAngle = 4;
|
|
1582
|
+
const startX = 50 + radius * Math.cos(startAngle * Math.PI / 180);
|
|
1583
|
+
const startY = 50 + radius * Math.sin(startAngle * Math.PI / 180);
|
|
1584
|
+
const endX = 50 + radius * Math.cos((startAngle + 360 / 20 - gapAngle) * Math.PI / 180);
|
|
1585
|
+
const endY = 50 + radius * Math.sin((startAngle + 360 / 20 - gapAngle) * Math.PI / 180);
|
|
1586
|
+
const isActive = i / 20 * 100 <= progress;
|
|
1587
|
+
return /* @__PURE__ */ jsx(
|
|
1588
|
+
motion.line,
|
|
1589
|
+
{
|
|
1590
|
+
x1: `${startX}`,
|
|
1591
|
+
y1: `${startY}`,
|
|
1592
|
+
x2: `${endX}`,
|
|
1593
|
+
y2: `${endY}`,
|
|
1594
|
+
stroke: isActive ? scoreColor2.stroke : "#334155",
|
|
1595
|
+
strokeWidth,
|
|
1596
|
+
strokeLinecap: "round",
|
|
1597
|
+
initial: { opacity: 0.3 },
|
|
1598
|
+
animate: {
|
|
1599
|
+
opacity: isActive ? 1 : 0.3,
|
|
1600
|
+
filter: isActive ? `drop-shadow(0 0 2px ${scoreColor2.stroke})` : "none"
|
|
1601
|
+
},
|
|
1602
|
+
transition: { duration: 0.3 }
|
|
1603
|
+
},
|
|
1604
|
+
i
|
|
1605
|
+
);
|
|
1606
|
+
})
|
|
1607
|
+
}
|
|
1608
|
+
),
|
|
1609
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex flex-col items-center justify-center z-20", children: /* @__PURE__ */ jsxs(
|
|
1610
|
+
motion.div,
|
|
1611
|
+
{
|
|
1612
|
+
initial: { scale: 0 },
|
|
1613
|
+
animate: isInView ? { scale: 1 } : { scale: 0 },
|
|
1614
|
+
transition: { duration: 0.5, delay: 0.3 },
|
|
1615
|
+
className: "text-center",
|
|
1616
|
+
children: [
|
|
1617
|
+
/* @__PURE__ */ jsx(
|
|
1618
|
+
motion.div,
|
|
1619
|
+
{
|
|
1620
|
+
className: cn("font-black mb-1", currentText.score),
|
|
1621
|
+
style: { color: scoreColor2.stroke },
|
|
1622
|
+
animate: {
|
|
1623
|
+
textShadow: `0 0 20px ${scoreColor2.glow}, 0 0 40px ${scoreColor2.glow}`
|
|
1624
|
+
},
|
|
1625
|
+
children: score
|
|
1626
|
+
}
|
|
1627
|
+
),
|
|
1628
|
+
showLabel && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1629
|
+
/* @__PURE__ */ jsx(
|
|
1630
|
+
"div",
|
|
1631
|
+
{
|
|
1632
|
+
className: cn(
|
|
1633
|
+
"font-bold uppercase tracking-wider text-slate-400 mb-0.5",
|
|
1634
|
+
currentText.label
|
|
1635
|
+
),
|
|
1636
|
+
children: "AI Readiness"
|
|
1637
|
+
}
|
|
1638
|
+
),
|
|
1639
|
+
/* @__PURE__ */ jsx(
|
|
1640
|
+
"div",
|
|
1641
|
+
{
|
|
1642
|
+
className: cn("font-black tracking-tight", currentText.title),
|
|
1643
|
+
style: { color: scoreColor2.stroke },
|
|
1644
|
+
children: "SCORE"
|
|
1645
|
+
}
|
|
1646
|
+
)
|
|
1647
|
+
] })
|
|
1648
|
+
]
|
|
1649
|
+
}
|
|
1650
|
+
) })
|
|
1651
|
+
] });
|
|
1652
|
+
}
|
|
744
1653
|
var sizeClasses = {
|
|
745
1654
|
sm: "h-4 w-4",
|
|
746
1655
|
md: "h-8 w-8",
|
|
@@ -846,6 +1755,104 @@ function EmptyState({
|
|
|
846
1755
|
)
|
|
847
1756
|
] });
|
|
848
1757
|
}
|
|
1758
|
+
function FeedbackWidget({
|
|
1759
|
+
apiEndpoint = "/api/feedback",
|
|
1760
|
+
onSuccess,
|
|
1761
|
+
onError,
|
|
1762
|
+
title = "Share Feedback",
|
|
1763
|
+
description = "What features would you like to see? Found a bug? Let us know!",
|
|
1764
|
+
className
|
|
1765
|
+
}) {
|
|
1766
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
1767
|
+
const [message, setMessage] = useState("");
|
|
1768
|
+
const [status, setStatus] = useState("idle");
|
|
1769
|
+
const handleSubmit = async (e) => {
|
|
1770
|
+
e.preventDefault();
|
|
1771
|
+
if (!message.trim()) return;
|
|
1772
|
+
setStatus("loading");
|
|
1773
|
+
try {
|
|
1774
|
+
const res = await fetch(apiEndpoint, {
|
|
1775
|
+
method: "POST",
|
|
1776
|
+
headers: { "Content-Type": "application/json" },
|
|
1777
|
+
body: JSON.stringify({ message })
|
|
1778
|
+
});
|
|
1779
|
+
if (!res.ok) throw new Error("Failed to send feedback");
|
|
1780
|
+
onSuccess?.(message);
|
|
1781
|
+
setMessage("");
|
|
1782
|
+
setIsOpen(false);
|
|
1783
|
+
} catch (err) {
|
|
1784
|
+
onError?.(err);
|
|
1785
|
+
} finally {
|
|
1786
|
+
setStatus("idle");
|
|
1787
|
+
}
|
|
1788
|
+
};
|
|
1789
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("fixed bottom-6 right-6 z-50", className), children: [
|
|
1790
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(
|
|
1791
|
+
motion.div,
|
|
1792
|
+
{
|
|
1793
|
+
initial: { opacity: 0, scale: 0.9, y: 20 },
|
|
1794
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
1795
|
+
exit: { opacity: 0, scale: 0.9, y: 20 },
|
|
1796
|
+
className: "absolute bottom-16 right-0 w-80 rounded-2xl p-4 bg-slate-900 border border-cyan-500/30 shadow-2xl backdrop-blur-xl",
|
|
1797
|
+
children: [
|
|
1798
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1799
|
+
/* @__PURE__ */ jsxs("h4", { className: "font-bold text-white flex items-center gap-2 text-sm", children: [
|
|
1800
|
+
/* @__PURE__ */ jsx(MessageSquare, { className: "w-4 h-4 text-cyan-400" }),
|
|
1801
|
+
title
|
|
1802
|
+
] }),
|
|
1803
|
+
/* @__PURE__ */ jsx(
|
|
1804
|
+
"button",
|
|
1805
|
+
{
|
|
1806
|
+
onClick: () => setIsOpen(false),
|
|
1807
|
+
className: "text-slate-500 hover:text-white",
|
|
1808
|
+
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
1809
|
+
}
|
|
1810
|
+
)
|
|
1811
|
+
] }),
|
|
1812
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-slate-400 mb-4", children: description }),
|
|
1813
|
+
/* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-3", children: [
|
|
1814
|
+
/* @__PURE__ */ jsx(
|
|
1815
|
+
"textarea",
|
|
1816
|
+
{
|
|
1817
|
+
autoFocus: true,
|
|
1818
|
+
value: message,
|
|
1819
|
+
onChange: (e) => setMessage(e.target.value),
|
|
1820
|
+
placeholder: "Type your feedback here...",
|
|
1821
|
+
required: true,
|
|
1822
|
+
className: "w-full bg-slate-800/50 border border-slate-700 rounded-xl px-3 py-2 text-sm text-white h-24 resize-none focus:outline-none focus:ring-1 focus:ring-cyan-500 transition-all"
|
|
1823
|
+
}
|
|
1824
|
+
),
|
|
1825
|
+
/* @__PURE__ */ jsx(
|
|
1826
|
+
"button",
|
|
1827
|
+
{
|
|
1828
|
+
type: "submit",
|
|
1829
|
+
disabled: status === "loading" || !message.trim(),
|
|
1830
|
+
className: "w-full py-2 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 text-white font-bold rounded-lg text-sm transition-all flex items-center justify-center gap-2",
|
|
1831
|
+
children: status === "loading" ? /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1832
|
+
/* @__PURE__ */ jsx(Send, { className: "w-3 h-3" }),
|
|
1833
|
+
"Send Feedback"
|
|
1834
|
+
] })
|
|
1835
|
+
}
|
|
1836
|
+
)
|
|
1837
|
+
] })
|
|
1838
|
+
]
|
|
1839
|
+
}
|
|
1840
|
+
) }),
|
|
1841
|
+
/* @__PURE__ */ jsxs(
|
|
1842
|
+
motion.button,
|
|
1843
|
+
{
|
|
1844
|
+
whileHover: { scale: 1.05 },
|
|
1845
|
+
whileTap: { scale: 0.95 },
|
|
1846
|
+
onClick: () => setIsOpen(!isOpen),
|
|
1847
|
+
className: "w-12 h-12 bg-gradient-to-br from-cyan-600 to-blue-600 text-white rounded-full flex items-center justify-center shadow-lg shadow-cyan-500/20 group overflow-hidden relative",
|
|
1848
|
+
children: [
|
|
1849
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-white/20 opacity-0 group-hover:opacity-100 transition-opacity" }),
|
|
1850
|
+
isOpen ? /* @__PURE__ */ jsx(X, { className: "w-6 h-6" }) : /* @__PURE__ */ jsx(MessageSquare, { className: "w-6 h-6" })
|
|
1851
|
+
]
|
|
1852
|
+
}
|
|
1853
|
+
)
|
|
1854
|
+
] });
|
|
1855
|
+
}
|
|
849
1856
|
var ThemeContext = createContext(void 0);
|
|
850
1857
|
var STORAGE_KEY = "aiready-theme";
|
|
851
1858
|
function getSystemTheme() {
|
|
@@ -1789,10 +2796,7 @@ var ForceDirectedGraph = forwardRef(
|
|
|
1789
2796
|
if (gRef.current && svgRef.current) {
|
|
1790
2797
|
const svg = d33.select(svgRef.current);
|
|
1791
2798
|
const newTransform = d33.zoomIdentity.translate(x, y).scale(scale);
|
|
1792
|
-
svg.transition().duration(300).call(
|
|
1793
|
-
d33.zoom().transform,
|
|
1794
|
-
newTransform
|
|
1795
|
-
);
|
|
2799
|
+
svg.transition().duration(300).call(d33.zoom().transform, newTransform);
|
|
1796
2800
|
setTransform(newTransform);
|
|
1797
2801
|
}
|
|
1798
2802
|
},
|
|
@@ -2224,6 +3228,6 @@ var GraphControls = ({
|
|
|
2224
3228
|
};
|
|
2225
3229
|
GraphControls.displayName = "GraphControls";
|
|
2226
3230
|
|
|
2227
|
-
export { Badge, Breadcrumb, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Container, EmptyState, ErrorDisplay, ForceDirectedGraph, GraphControls, Grid, InlineCode, Input, Label, LoadingOverlay, LoadingSpinner, RadioGroup, ScoreBar, ScoreCard, Select, Separator, Stack, Switch, Textarea, ThemeProvider, badgeVariants, buttonVariants, chartColors, cn, domainColors, formatCompactNumber, formatDate, formatDateTime, formatDecimal, formatDuration, formatFileSize, formatMetric, formatNumber, formatPercentage, formatRange, formatRelativeTime, getDomainColor, getScoreRating, getSeverityColor, hexToRgba, scoreBg, scoreColor, scoreGlow, scoreLabel, severityColors, useD3, useD3WithResize, useDebounce, useDrag, useForceSimulation, useTheme };
|
|
3231
|
+
export { AlertCircleIcon, Badge, BrainIcon, Breadcrumb, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartIcon, Checkbox, CodeBlock, CommandLineIcon, Container, EmptyState, ErrorDisplay, FeedbackWidget, FileIcon, ForceDirectedGraph, GlassCard, GlassCardContent, GlassCardHeader, GraphControls, Grid, InfoIcon, InlineCode, Input, Label, LoadingOverlay, LoadingSpinner, Modal, PlatformShell, PlayIcon, RadioGroup, RefreshCwIcon, RobotIcon, RocketIcon, SaveIcon, ScoreBar, ScoreCard, ScoreCircle, Select, Separator, SettingsIcon, ShieldIcon, Stack, Switch, TargetIcon, TerminalIcon, Textarea, ThemeProvider, TrashIcon, TrendingUpIcon, UploadIcon, badgeVariants, buttonVariants, chartColors, cn, domainColors, formatCompactNumber, formatDate, formatDateTime, formatDecimal, formatDuration, formatFileSize, formatMetric, formatNumber, formatPercentage, formatRange, formatRelativeTime, getDomainColor, getScoreRating, getSeverityColor, hexToRgba, scoreBg, scoreColor, scoreGlow, scoreLabel, severityColors, useD3, useD3WithResize, useDebounce, useDrag, useForceSimulation, useTheme };
|
|
2228
3232
|
//# sourceMappingURL=index.js.map
|
|
2229
3233
|
//# sourceMappingURL=index.js.map
|