organify-ui 0.3.39 → 0.3.41

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/index.js CHANGED
@@ -1,14 +1,15 @@
1
- import { Popover, PopoverTrigger, PopoverContent } from './chunk-65SJI47W.js';
2
- export { NotificationBell, NotificationItem, NotificationList, OrganifyNotifications, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PresenceAvatarStack, PresenceIndicator, useNotifications, usePresence } from './chunk-65SJI47W.js';
3
- export { createAiClient, useAiChat, useAiCommand, useAiSuggest, useAiUsage } from './chunk-NV4RWAQ2.js';
1
+ import { Popover, PopoverTrigger, PopoverContent } from './chunk-EQ3A7A2C.js';
2
+ export { NotificationBell, NotificationItem, NotificationList, OrganifyNotifications, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PresenceAvatarStack, PresenceIndicator, useNotifications, usePresence } from './chunk-EQ3A7A2C.js';
3
+ import { useAiProjectWizard } from './chunk-XSPNTWET.js';
4
+ export { createAiClient, useAiChat, useAiCommand, useAiProjectWizard, useAiSuggest, useAiUsage } from './chunk-XSPNTWET.js';
4
5
  export { I18nProvider, createTranslator, useI18n } from './chunk-FQA33MF4.js';
5
6
  export { ThemeProvider, useTheme } from './chunk-RFOKENE3.js';
6
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, UserAvatar, ResponsiveDialog, Separator, Label, Input, Textarea, Button, UserDisplayName, Tabs, TabsList, TabsTrigger, TabsContent, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DialogFooter, DialogClose } from './chunk-V3UZIPZA.js';
7
- export { AiChatSidebar, Alert, Button, ChatMessages, ChatSidebar, CommandBar, CreateRoomDialog, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, InlineAiButton, Input, Label, MOCK_PROJECTS, MOCK_USERS, OrgLoader, OrgLoaderInline, OrganifyChat, ResponsiveDialog, RoomManagementPanel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TypingIndicatorMock, UserAvatar, UserDisplayName, alertVariants, buttonVariants, generateAutoReplies, getMockMentionOptions, getRoomPermissions, inputVariants, invalidateUserCache, orgLoaderVariants, resolveUser, seedUserCache, typingIndicator, useAiInline, useChat, useResolvedUser } from './chunk-V3UZIPZA.js';
7
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, UserAvatar, ResponsiveDialog, Separator, Label, Input, Textarea, Button, UserDisplayName, Tabs, TabsList, TabsTrigger, TabsContent, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DialogFooter, DialogClose } from './chunk-TMWQH4P7.js';
8
+ export { AiChatSidebar, Alert, Button, ChatMessages, ChatSidebar, CommandBar, CreateRoomDialog, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, InlineAiButton, Input, Label, MOCK_PROJECTS, MOCK_USERS, OrgLoader, OrgLoaderInline, OrganifyChat, ResponsiveDialog, RoomManagementPanel, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, TypingIndicatorMock, UserAvatar, UserDisplayName, alertVariants, buttonVariants, generateAutoReplies, getMockMentionOptions, getRoomPermissions, inputVariants, invalidateUserCache, orgLoaderVariants, resolveUser, seedUserCache, typingIndicator, useAiInline, useChat, useResolvedUser } from './chunk-TMWQH4P7.js';
8
9
  import { cn, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, Skeleton, useOrganify, useOrganifyGql, Avatar, AvatarFallback, useOrganifyUser, useOrganifyApi, Badge, ScrollArea, useOrganifyWorkspace, useOrganifyNavigation, useOrganifyProject, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, AvatarImage } from './chunk-UUBQQVDM.js';
9
10
  export { Avatar, AvatarFallback, AvatarImage, Badge, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, OrganifyContext, OrganifyProvider, ScrollArea, ScrollBar, Skeleton, SkeletonCard, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, avatarVariants, badgeVariants, cn, useOrganify, useOrganifyApi, useOrganifyGql, useOrganifyNavigation, useOrganifyProject, useOrganifyRest, useOrganifyUser, useOrganifyWorkspace } from './chunk-UUBQQVDM.js';
10
- import { OrgDiamond, OrgPlus, OrgComment, OrgEdit, OrgTrash, OrgSprint, OrgCheckCircle, OrgAttachment, OrgCalendar, OrgMail, OrgBoard, OrgRocket, OrgWarning, OrgFlag, OrgShield, OrgZap, OrgStar } from './chunk-MZKEDV5W.js';
11
- export { OrgAI, OrgActivity, OrgArrowLeft, OrgArrowRight, OrgAttachment, OrgBell, OrgBoard, OrgCalendar, OrgCelebrate, OrgChart, OrgChat, OrgCheck, OrgCheckCircle, OrgChevronDown, OrgChevronLeft, OrgChevronRight, OrgChevronUp, OrgClock, OrgClose, OrgComment, OrgCopy, OrgCreditCard, OrgTrash as OrgDelete, OrgDeveloper, OrgDiamond, OrgDoor, OrgDownload, OrgEdit, OrgError, OrgExecutive, OrgEye, OrgEyeOff, OrgFile, OrgFilter, OrgFlag, OrgFolder, OrgGauge, OrgGlobe, OrgGrid, OrgHeart, OrgHome, OrgInfo, OrgIntegration, OrgLink, OrgList, OrgLock, OrgLogo, OrgLogout, OrgMail, OrgMention, OrgMenu, OrgMoon, OrgPMO, OrgPause, OrgPlay, OrgPlus, OrgProjectManager, OrgReport, OrgRocket, OrgSearch, OrgSettings, OrgShield, OrgSort, OrgSprint, OrgStakeholder, OrgStar, OrgSun, OrgTag, OrgTarget, OrgTeam, OrgTrash, OrgTutorial, OrgUnlock, OrgUpload, OrgUser, OrgWarning, OrgWave, OrgWordmark, OrgWorkflow, OrgWorkspace, OrgZap } from './chunk-MZKEDV5W.js';
11
+ import { OrgDiamond, OrgPlus, OrgComment, OrgEdit, OrgTrash, OrgSprint, OrgCheckCircle, OrgAttachment, OrgCalendar, OrgMail, OrgBoard, OrgRocket, OrgWarning, OrgFlag, OrgShield, OrgZap, OrgStar } from './chunk-J5TEVLDY.js';
12
+ export { OrgAI, OrgActivity, OrgArrowLeft, OrgArrowRight, OrgAttachment, OrgBell, OrgBoard, OrgCalendar, OrgCelebrate, OrgChart, OrgChat, OrgCheck, OrgCheckCircle, OrgChevronDown, OrgChevronLeft, OrgChevronRight, OrgChevronUp, OrgClock, OrgClose, OrgComment, OrgCopy, OrgCreditCard, OrgTrash as OrgDelete, OrgDeveloper, OrgDiamond, OrgDoor, OrgDownload, OrgEdit, OrgError, OrgExecutive, OrgEye, OrgEyeOff, OrgFile, OrgFilter, OrgFlag, OrgFolder, OrgGauge, OrgGlobe, OrgGrid, OrgHeart, OrgHome, OrgInfo, OrgIntegration, OrgLink, OrgList, OrgLock, OrgLogo, OrgLogout, OrgMail, OrgMention, OrgMenu, OrgMoon, OrgNote, OrgPMO, OrgPause, OrgPin, OrgPlay, OrgPlus, OrgProjectManager, OrgReport, OrgRocket, OrgSearch, OrgSettings, OrgShield, OrgSort, OrgSprint, OrgStakeholder, OrgStar, OrgSun, OrgTag, OrgTarget, OrgTeam, OrgTrash, OrgTutorial, OrgUnlock, OrgUpload, OrgUser, OrgWarning, OrgWave, OrgWordmark, OrgWorkflow, OrgWorkspace, OrgZap } from './chunk-J5TEVLDY.js';
12
13
  import * as React11 from 'react';
13
14
  import * as SwitchPrimitive from '@radix-ui/react-switch';
14
15
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -9223,6 +9224,400 @@ function CreateProjectDialog({
9223
9224
  }
9224
9225
  );
9225
9226
  }
9227
+ var spinnerVariants = cva("animate-spin", {
9228
+ variants: {
9229
+ variant: {
9230
+ ring: "",
9231
+ orbit: "",
9232
+ dots: ""
9233
+ },
9234
+ size: {
9235
+ sm: "h-4 w-4",
9236
+ default: "h-6 w-6",
9237
+ lg: "h-10 w-10",
9238
+ xl: "h-12 w-12"
9239
+ }
9240
+ },
9241
+ defaultVariants: {
9242
+ variant: "ring",
9243
+ size: "default"
9244
+ }
9245
+ });
9246
+ function Spinner({ className, variant = "ring", size, caption, ...props }) {
9247
+ if (variant === "orbit") {
9248
+ const sizeMap = { sm: 16, default: 24, lg: 40, xl: 48 };
9249
+ const s = sizeMap[size || "default"];
9250
+ const r = (s - 4) / 2;
9251
+ const circumference = 2 * Math.PI * r;
9252
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-3", className), ...props, children: [
9253
+ /* @__PURE__ */ jsxs("div", { className: cn("relative flex items-center justify-center", spinnerVariants({ size })), children: [
9254
+ /* @__PURE__ */ jsxs("svg", { className: "h-full w-full -rotate-90", children: [
9255
+ /* @__PURE__ */ jsx(
9256
+ "circle",
9257
+ {
9258
+ className: "text-theme-subtle",
9259
+ cx: s / 2,
9260
+ cy: s / 2,
9261
+ fill: "transparent",
9262
+ r,
9263
+ stroke: "currentColor",
9264
+ strokeWidth: "1"
9265
+ }
9266
+ ),
9267
+ /* @__PURE__ */ jsx(
9268
+ "circle",
9269
+ {
9270
+ className: "text-primary-light drop-shadow-[0_0_8px_rgba(80,60,246,0.6)]",
9271
+ cx: s / 2,
9272
+ cy: s / 2,
9273
+ fill: "transparent",
9274
+ r,
9275
+ stroke: "currentColor",
9276
+ strokeDasharray: circumference,
9277
+ strokeDashoffset: circumference * 0.24,
9278
+ strokeWidth: "2"
9279
+ }
9280
+ )
9281
+ ] }),
9282
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-1 w-1 rounded-full bg-white" }) })
9283
+ ] }),
9284
+ caption && /* @__PURE__ */ jsx("span", { className: "font-mono text-[9px] uppercase tracking-widest text-theme-muted", children: caption })
9285
+ ] });
9286
+ }
9287
+ if (variant === "dots") {
9288
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-3", className), ...props, children: [
9289
+ /* @__PURE__ */ jsx("div", { className: "flex gap-1", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx(
9290
+ "div",
9291
+ {
9292
+ className: cn(
9293
+ "rounded-full bg-primary-light",
9294
+ size === "sm" && "h-1 w-1",
9295
+ (size === "default" || !size) && "h-1.5 w-1.5",
9296
+ size === "lg" && "h-2 w-2",
9297
+ size === "xl" && "h-2.5 w-2.5"
9298
+ ),
9299
+ style: {
9300
+ animation: `pulse 1.4s ease-in-out ${i * 0.2}s infinite`
9301
+ }
9302
+ },
9303
+ i
9304
+ )) }),
9305
+ caption && /* @__PURE__ */ jsx("span", { className: "font-mono text-[9px] uppercase tracking-widest text-theme-muted", children: caption })
9306
+ ] });
9307
+ }
9308
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center gap-3", className), ...props, children: [
9309
+ /* @__PURE__ */ jsx(
9310
+ "div",
9311
+ {
9312
+ className: cn(
9313
+ "rounded-full border border-primary/15 border-r-primary-light border-t-primary-light",
9314
+ spinnerVariants({ size })
9315
+ )
9316
+ }
9317
+ ),
9318
+ caption && /* @__PURE__ */ jsx("span", { className: "font-mono text-[9px] uppercase tracking-widest text-org-text-muted", children: caption })
9319
+ ] });
9320
+ }
9321
+ var PHASE_LABELS = ["Inicia\xE7\xE3o", "An\xE1lise", "Metodologia", "Configura\xE7\xE3o", "Cria\xE7\xE3o"];
9322
+ function ProgressStepper({ phase }) {
9323
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 px-4 py-2 overflow-x-auto flex-shrink-0", children: PHASE_LABELS.map((label, idx) => /* @__PURE__ */ jsxs(React11.Fragment, { children: [
9324
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5 min-w-fit", children: [
9325
+ /* @__PURE__ */ jsx(
9326
+ "div",
9327
+ {
9328
+ className: cn(
9329
+ "w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold transition-colors",
9330
+ idx < phase ? "bg-primary text-primary-foreground" : idx === phase ? "bg-primary/80 text-primary-foreground ring-2 ring-primary/30" : "bg-muted text-muted-foreground"
9331
+ ),
9332
+ children: idx < phase ? "\u2713" : idx + 1
9333
+ }
9334
+ ),
9335
+ /* @__PURE__ */ jsx(
9336
+ "span",
9337
+ {
9338
+ className: cn(
9339
+ "text-[10px] whitespace-nowrap",
9340
+ idx === phase ? "text-foreground font-medium" : "text-muted-foreground"
9341
+ ),
9342
+ children: label
9343
+ }
9344
+ )
9345
+ ] }),
9346
+ idx < PHASE_LABELS.length - 1 && /* @__PURE__ */ jsx(
9347
+ "div",
9348
+ {
9349
+ className: cn(
9350
+ "h-px flex-1 min-w-[12px] transition-colors mb-3",
9351
+ idx < phase ? "bg-primary" : "bg-border"
9352
+ )
9353
+ }
9354
+ )
9355
+ ] }, label)) });
9356
+ }
9357
+ function ChatBubble({ msg, learningMode }) {
9358
+ const isUser = msg.role === "user";
9359
+ if (msg.loading) {
9360
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
9361
+ /* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx("span", { className: "text-xs", children: "AI" }) }),
9362
+ /* @__PURE__ */ jsxs("div", { className: "bg-muted rounded-2xl rounded-bl-sm px-3 py-2 flex items-center gap-1.5 min-h-[36px]", children: [
9363
+ /* @__PURE__ */ jsx(Spinner, { size: "sm" }),
9364
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: "Pensando..." })
9365
+ ] })
9366
+ ] });
9367
+ }
9368
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex items-end gap-2", isUser && "flex-row-reverse"), children: [
9369
+ !isUser && /* @__PURE__ */ jsx("div", { className: "w-7 h-7 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0 text-xs font-semibold", children: "AI" }),
9370
+ /* @__PURE__ */ jsxs(
9371
+ "div",
9372
+ {
9373
+ className: cn(
9374
+ "max-w-[80%] rounded-2xl px-3 py-2 text-sm",
9375
+ isUser ? "bg-primary text-primary-foreground rounded-br-sm" : "bg-muted text-foreground rounded-bl-sm"
9376
+ ),
9377
+ children: [
9378
+ msg.content && /* @__PURE__ */ jsx("p", { className: "whitespace-pre-wrap", children: msg.content }),
9379
+ msg.richContent && /* @__PURE__ */ jsx(
9380
+ RichContentBlock,
9381
+ {
9382
+ richContent: msg.richContent,
9383
+ learningMode
9384
+ }
9385
+ )
9386
+ ]
9387
+ }
9388
+ )
9389
+ ] });
9390
+ }
9391
+ function RichContentBlock({
9392
+ richContent,
9393
+ learningMode
9394
+ }) {
9395
+ if (richContent.type === "methodology_recommendation" && richContent.methodologyOptions) {
9396
+ return /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-col gap-2", children: richContent.methodologyOptions.map((opt) => /* @__PURE__ */ jsx(MethodologyCard, { option: opt, showLearn: learningMode }, opt.name)) });
9397
+ }
9398
+ if (richContent.type === "project_created") {
9399
+ return /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-2 text-sm text-emerald-600 dark:text-emerald-400", children: [
9400
+ /* @__PURE__ */ jsx("span", { children: "\u2705" }),
9401
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: "Projeto criado com sucesso!" })
9402
+ ] });
9403
+ }
9404
+ return null;
9405
+ }
9406
+ function MethodologyCard({
9407
+ option,
9408
+ showLearn
9409
+ }) {
9410
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-background/80 p-3 flex flex-col gap-1", children: [
9411
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
9412
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: option.name }),
9413
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-xs", children: option.complexity === "simple" ? "Simples" : option.complexity === "medium" ? "M\xE9dio" : "Avan\xE7ado" })
9414
+ ] }),
9415
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: option.description }),
9416
+ showLearn && option.learn && /* @__PURE__ */ jsxs("p", { className: "text-xs text-blue-600 dark:text-blue-400 border-l-2 border-blue-400 pl-2 mt-1", children: [
9417
+ "\u{1F4A1} ",
9418
+ option.learn
9419
+ ] }),
9420
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-1", children: option.bestFor.map((tag) => /* @__PURE__ */ jsx(
9421
+ "span",
9422
+ {
9423
+ className: "text-[10px] bg-primary/10 text-primary rounded px-1.5 py-0.5",
9424
+ children: tag
9425
+ },
9426
+ tag
9427
+ )) })
9428
+ ] });
9429
+ }
9430
+ function ProjectPreviewPanel({ preview }) {
9431
+ if (!preview) {
9432
+ return /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col items-center justify-center text-muted-foreground gap-2 p-6", children: [
9433
+ /* @__PURE__ */ jsx("div", { className: "text-4xl opacity-30", children: "\u{1F4CB}" }),
9434
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-center", children: "A pr\xE9-visualiza\xE7\xE3o do projeto aparecer\xE1 aqui conforme voc\xEA responde." })
9435
+ ] });
9436
+ }
9437
+ return /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto p-4 flex flex-col gap-3", children: [
9438
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm text-muted-foreground uppercase tracking-wide", children: "Pr\xE9-visualiza\xE7\xE3o" }),
9439
+ /* @__PURE__ */ jsxs("div", { className: "rounded-xl border bg-card p-4 flex flex-col gap-3", children: [
9440
+ preview.name && /* @__PURE__ */ jsxs("div", { children: [
9441
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Nome" }),
9442
+ /* @__PURE__ */ jsx("p", { className: "font-semibold", children: preview.name })
9443
+ ] }),
9444
+ preview.description && /* @__PURE__ */ jsxs("div", { children: [
9445
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Descri\xE7\xE3o" }),
9446
+ /* @__PURE__ */ jsx("p", { className: "text-sm", children: preview.description })
9447
+ ] }),
9448
+ preview.methodology && /* @__PURE__ */ jsxs("div", { children: [
9449
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Metodologia" }),
9450
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: preview.methodology })
9451
+ ] }),
9452
+ preview.suggestedPhases && preview.suggestedPhases.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
9453
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-1", children: "Fases sugeridas" }),
9454
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: preview.suggestedPhases.map((ph) => /* @__PURE__ */ jsx(
9455
+ "span",
9456
+ {
9457
+ className: "text-xs bg-muted rounded px-2 py-0.5",
9458
+ children: ph
9459
+ },
9460
+ ph
9461
+ )) })
9462
+ ] }),
9463
+ preview.estimatedDuration && /* @__PURE__ */ jsxs("div", { children: [
9464
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Dura\xE7\xE3o estimada" }),
9465
+ /* @__PURE__ */ jsx("p", { className: "text-sm", children: preview.estimatedDuration })
9466
+ ] }),
9467
+ preview.teamSize && /* @__PURE__ */ jsxs("div", { children: [
9468
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Tamanho da equipe" }),
9469
+ /* @__PURE__ */ jsxs("p", { className: "text-sm", children: [
9470
+ preview.teamSize,
9471
+ " pessoa",
9472
+ preview.teamSize !== 1 ? "s" : ""
9473
+ ] })
9474
+ ] })
9475
+ ] })
9476
+ ] });
9477
+ }
9478
+ function QuickReplyBar({
9479
+ replies,
9480
+ onSelect,
9481
+ disabled
9482
+ }) {
9483
+ if (!replies.length) return null;
9484
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 px-4 pb-1", children: replies.map((r) => /* @__PURE__ */ jsx(
9485
+ "button",
9486
+ {
9487
+ disabled,
9488
+ onClick: () => onSelect(r),
9489
+ className: "text-xs rounded-full border px-3 py-1 hover:bg-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
9490
+ children: r
9491
+ },
9492
+ r
9493
+ )) });
9494
+ }
9495
+ function AiProjectWizard({
9496
+ open,
9497
+ onOpenChange,
9498
+ workspaceId,
9499
+ client,
9500
+ onCreated
9501
+ }) {
9502
+ const {
9503
+ messages,
9504
+ loading,
9505
+ error,
9506
+ phase,
9507
+ projectPreview,
9508
+ quickReplies,
9509
+ learningMode,
9510
+ setLearningMode,
9511
+ send,
9512
+ reset
9513
+ } = useAiProjectWizard({ client, workspaceId, onCreated });
9514
+ const [input, setInput] = React11.useState("");
9515
+ const messagesEndRef = React11.useRef(null);
9516
+ const greetedRef = React11.useRef(false);
9517
+ React11.useEffect(() => {
9518
+ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
9519
+ }, [messages]);
9520
+ React11.useEffect(() => {
9521
+ if (open && !greetedRef.current && messages.length === 0) {
9522
+ greetedRef.current = true;
9523
+ send("Ol\xE1! Quero criar um projeto.");
9524
+ }
9525
+ if (!open) {
9526
+ greetedRef.current = false;
9527
+ }
9528
+ }, [open, messages.length, send]);
9529
+ function handleClose() {
9530
+ reset();
9531
+ setInput("");
9532
+ onOpenChange(false);
9533
+ }
9534
+ async function handleSend() {
9535
+ const text = input.trim();
9536
+ if (!text) return;
9537
+ setInput("");
9538
+ await send(text);
9539
+ }
9540
+ function handleKeyDown(e) {
9541
+ if (e.key === "Enter" && !e.shiftKey) {
9542
+ e.preventDefault();
9543
+ void handleSend();
9544
+ }
9545
+ }
9546
+ return /* @__PURE__ */ jsx(Sheet, { open, onOpenChange: (v) => {
9547
+ if (!v) handleClose();
9548
+ }, children: /* @__PURE__ */ jsxs(
9549
+ SheetContent,
9550
+ {
9551
+ side: "right",
9552
+ className: "w-full sm:max-w-2xl lg:max-w-4xl p-0 flex flex-col gap-0 overflow-hidden",
9553
+ children: [
9554
+ /* @__PURE__ */ jsxs(SheetHeader, { className: "flex-shrink-0 px-4 pt-4 pb-0 border-b", children: [
9555
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between pb-3", children: [
9556
+ /* @__PURE__ */ jsx(SheetTitle, { className: "text-base font-semibold", children: "\u2728 Criar projeto com IA" }),
9557
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
9558
+ /* @__PURE__ */ jsx(
9559
+ Switch,
9560
+ {
9561
+ id: "learning-mode",
9562
+ checked: learningMode,
9563
+ onCheckedChange: setLearningMode,
9564
+ className: "scale-90"
9565
+ }
9566
+ ),
9567
+ /* @__PURE__ */ jsx(Label, { htmlFor: "learning-mode", className: "text-xs text-muted-foreground cursor-pointer select-none", children: "Modo Aprendizado" })
9568
+ ] })
9569
+ ] }),
9570
+ /* @__PURE__ */ jsx(ProgressStepper, { phase })
9571
+ ] }),
9572
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
9573
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
9574
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 px-4 py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
9575
+ messages.map((msg) => /* @__PURE__ */ jsx(ChatBubble, { msg, learningMode }, msg.id)),
9576
+ error && /* @__PURE__ */ jsx("div", { className: "text-xs text-destructive bg-destructive/10 rounded px-2 py-1 text-center", children: error }),
9577
+ /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
9578
+ ] }) }),
9579
+ /* @__PURE__ */ jsx(
9580
+ QuickReplyBar,
9581
+ {
9582
+ replies: quickReplies,
9583
+ onSelect: (r) => {
9584
+ setInput("");
9585
+ void send(r);
9586
+ },
9587
+ disabled: loading
9588
+ }
9589
+ ),
9590
+ /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 border-t px-4 py-3 flex gap-2 items-end", children: [
9591
+ /* @__PURE__ */ jsx(
9592
+ Textarea,
9593
+ {
9594
+ value: input,
9595
+ onChange: (e) => setInput(e.target.value),
9596
+ onKeyDown: handleKeyDown,
9597
+ placeholder: "Escreva uma mensagem\u2026 (Enter para enviar)",
9598
+ disabled: loading,
9599
+ className: "resize-none min-h-[40px] max-h-[120px] text-sm",
9600
+ rows: 1
9601
+ }
9602
+ ),
9603
+ /* @__PURE__ */ jsx(
9604
+ Button,
9605
+ {
9606
+ size: "sm",
9607
+ onClick: () => void handleSend(),
9608
+ disabled: loading || !input.trim(),
9609
+ className: "shrink-0 h-10",
9610
+ children: loading ? /* @__PURE__ */ jsx(Spinner, { size: "sm" }) : "Enviar"
9611
+ }
9612
+ )
9613
+ ] })
9614
+ ] }),
9615
+ /* @__PURE__ */ jsx("div", { className: "hidden lg:flex flex-col w-72 border-l flex-shrink-0 overflow-hidden", children: /* @__PURE__ */ jsx(ProjectPreviewPanel, { preview: projectPreview }) })
9616
+ ] })
9617
+ ]
9618
+ }
9619
+ ) });
9620
+ }
9226
9621
  var CREATE_WORKSPACE_MUTATION2 = `
9227
9622
  mutation CreateWorkspace($input: CreateWorkspaceInput!) {
9228
9623
  createWorkspace(input: $input) {
@@ -9956,6 +10351,6 @@ function InviteMemberDialog({
9956
10351
  );
9957
10352
  }
9958
10353
 
9959
- export { ActivityTrail, ActivityTrailSkeleton, BoardSkeleton, BoardsSwitcher, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, CURRENT_USER_KEY, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentItem, CommentThread, CreateEpicDialog, CreateProjectDialog, CreateSprintDialog, CreateTaskDialog, CreateWorkspaceDialog, DashboardSkeleton, Dock, DockButton, DockSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, GeometricIcon, GlassPanel, InviteMemberDialog, KanbanBoard, Column as KanbanColumn, TaskCard2 as KanbanTaskCard, Logo, MemberListSkeleton, MetricCard, MetricCardSkeleton, PlanBadge, Progress, ProjectListSkeleton, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, SprintFilter, SprintSkeleton, StatusPill, StepCircle, StepConnector, Stepper, Switch, TaskCard, TaskCardSkeleton, TaskDetailDialog, TaskDetailPanel, TaskDetailSheet, TaskListSkeleton, Toast, ToastProgress, Toaster, Toggle, WorkspaceSwitcher, emptyMediaVariants, geometricIconVariants, glassPanelVariants, metricCardVariants, priorityConfig, statusPillVariants, useCurrentUser, useMediaQuery };
10354
+ export { ActivityTrail, ActivityTrailSkeleton, AiProjectWizard, BoardSkeleton, BoardsSwitcher, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, CURRENT_USER_KEY, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentItem, CommentThread, CreateEpicDialog, CreateProjectDialog, CreateSprintDialog, CreateTaskDialog, CreateWorkspaceDialog, DashboardSkeleton, Dock, DockButton, DockSidebar, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, GeometricIcon, GlassPanel, InviteMemberDialog, KanbanBoard, Column as KanbanColumn, TaskCard2 as KanbanTaskCard, Logo, MemberListSkeleton, MetricCard, MetricCardSkeleton, PlanBadge, Progress, ProjectListSkeleton, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, SprintFilter, SprintSkeleton, StatusPill, StepCircle, StepConnector, Stepper, Switch, TaskCard, TaskCardSkeleton, TaskDetailDialog, TaskDetailPanel, TaskDetailSheet, TaskListSkeleton, Toast, ToastProgress, Toaster, Toggle, WorkspaceSwitcher, emptyMediaVariants, geometricIconVariants, glassPanelVariants, metricCardVariants, priorityConfig, statusPillVariants, useCurrentUser, useMediaQuery };
9960
10355
  //# sourceMappingURL=index.js.map
9961
10356
  //# sourceMappingURL=index.js.map