organify-ui 0.3.32 → 0.3.33

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.d.ts CHANGED
@@ -1601,7 +1601,9 @@ interface InviteMemberDialogProps {
1601
1601
  id: string;
1602
1602
  email: string;
1603
1603
  }) => void;
1604
+ /** Default view to show when opening */
1605
+ defaultView?: 'invite' | 'sent';
1604
1606
  }
1605
- declare function InviteMemberDialog({ open, onOpenChange, workspaceSlug: propWorkspaceSlug, workspaceId: _deprecated, onInvited, }: InviteMemberDialogProps): react_jsx_runtime.JSX.Element;
1607
+ declare function InviteMemberDialog({ open, onOpenChange, workspaceSlug: propWorkspaceSlug, workspaceId: _deprecated, onInvited, defaultView, }: InviteMemberDialogProps): react_jsx_runtime.JSX.Element;
1606
1608
 
1607
1609
  export { type ActivityAction, type ActivityEntry, ActivityTrail, type ActivityTrailProps, ActivityTrailSkeleton, Alert, type AlertProps, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, type BoardItem, BoardSkeleton, BoardsSwitcher, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CURRENT_USER_KEY, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatSkeleton, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, type Comment, type CommentAuthor, CommentItem, type CommentReaction, CommentThread, type CommentThreadProps, CreateEpicDialog, type CreateEpicDialogProps, CreateProjectDialog, type CreateProjectDialogProps, CreateSprintDialog, type CreateSprintDialogProps, CreateTaskDialog, type CreateTaskDialogProps, CreateWorkspaceDialog, type CreateWorkspaceDialogProps, DashboardSkeleton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dock, DockButton, type DockEntry, type DockItem, type DockProps, DockSidebar, type DockSidebarProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DueDateBadge, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, GeometricIcon, type GeometricIconProps, GlassPanel, type GlassPanelProps, type GqlEndpoint, Input, type InputProps, InviteMemberDialog, type InviteMemberDialogProps, KanbanBoard, type KanbanBoardProps, Column as KanbanColumn, type KanbanColumnData, type KanbanTask, TaskCard as KanbanTaskCard, Label, Logo, type LogoProps, MemberListSkeleton, MetricCard, type MetricCardProps, MetricCardSkeleton, OrgLoader, OrgLoaderInline, type OrgLoaderProps, type OrganifyApiConfig, OrganifyContext, type OrganifyContextValue, type OrganifyProject, OrganifyProvider, type OrganifyProviderProps, type OrganifyUser, type OrganifyWorkspace, PlanBadge, type PlanBadgeProps, type PlanLimit, type PlanTier, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, type ProgressProps, ProjectListSkeleton, type ResolvedUser, ResponsiveDialog, type ResponsiveDialogProps, type RestEndpoint, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsSkeleton, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarButton, SidebarEntry, type SidebarNavEntry, type SidebarNavItem, Skeleton, SkeletonCard, type SkeletonProps, type Sprint, SprintFilter, SprintSkeleton, StatusPill, type StatusPillProps, StepCircle, StepConnector, type StepStatus, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, type TaskAssignee, TaskCard$1 as TaskCard, type TaskCardData, type TaskCardProps$1 as TaskCardProps, TaskCardSkeleton, type TaskDetailData, TaskDetailDialog, type TaskDetailDialogProps, TaskDetailPanel, type TaskDetailPanelProps, TaskDetailSheet, type TaskDetailSheetProps, type TaskLabel, TaskListSkeleton, type TaskPriority, type TaskStatus, type TaskSubtask, Textarea, Toast, ToastProgress, type ToastProps, Toaster, type ToasterProps, Toggle, type ToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseCurrentUserReturn, UserAvatar, type UserAvatarProps, UserDisplayName, type UserDisplayNameProps, WorkspaceSwitcher, type WorkspaceSwitcherProps, alertVariants, avatarVariants, badgeVariants, buttonVariants, cn, emptyMediaVariants, geometricIconVariants, glassPanelVariants, inputVariants, invalidateUserCache, metricCardVariants, orgLoaderVariants, priorityConfig, resolveUser, seedUserCache, statusPillVariants, useCurrentUser, useMediaQuery, useOrganify, useOrganifyApi, useOrganifyGql, useOrganifyNavigation, useOrganifyProject, useOrganifyRest, useOrganifyUser, useOrganifyWorkspace, useResolvedUser };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { NotificationBell, NotificationItem, NotificationList, OrganifyNotificat
3
3
  export { createAiClient, useAiChat, useAiCommand, useAiSuggest, useAiUsage } from './chunk-NV4RWAQ2.js';
4
4
  export { I18nProvider, createTranslator, useI18n } from './chunk-FQA33MF4.js';
5
5
  export { ThemeProvider, useTheme } from './chunk-RFOKENE3.js';
6
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, UserAvatar, ResponsiveDialog, Separator, Label, Input, Textarea, Button, UserDisplayName, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-GI5LONCN.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 } from './chunk-GI5LONCN.js';
7
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-GI5LONCN.js';
8
8
  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
9
  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';
@@ -9301,20 +9301,35 @@ function CreateTaskDialog({
9301
9301
  }
9302
9302
  var INVITE_MEMBER_MUTATION = `
9303
9303
  mutation InviteWorkspaceMember($slug: String!, $input: InviteMemberInput!) {
9304
- inviteWorkspaceMember(slug: $slug, input: $input) {
9305
- id
9306
- email
9307
- role
9308
- status
9304
+ inviteWorkspaceMember(slug: $slug, input: $input) {
9305
+ id
9306
+ email
9307
+ role
9308
+ status
9309
+ }
9310
+ }
9311
+ `;
9312
+ var GET_SENT_INVITES = `
9313
+ query SentWorkspaceInvites($workspaceSlug: String) {
9314
+ sentWorkspaceInvites(workspaceSlug: $workspaceSlug) {
9315
+ id
9316
+ email
9317
+ role
9318
+ status
9319
+ workspace {
9320
+ name
9321
+ avatarUrl
9309
9322
  }
9310
9323
  }
9324
+ }
9311
9325
  `;
9312
9326
  function InviteMemberDialog({
9313
9327
  open,
9314
9328
  onOpenChange,
9315
9329
  workspaceSlug: propWorkspaceSlug,
9316
9330
  workspaceId: _deprecated,
9317
- onInvited
9331
+ onInvited,
9332
+ defaultView = "invite"
9318
9333
  }) {
9319
9334
  const gql = useOrganifyGql();
9320
9335
  const { workspace } = useOrganifyWorkspace();
@@ -9323,13 +9338,34 @@ function InviteMemberDialog({
9323
9338
  const [role, setRole] = React5.useState("MEMBER");
9324
9339
  const [error, setError] = React5.useState("");
9325
9340
  const [loading, setLoading] = React5.useState(false);
9341
+ const [sentInvites, setSentInvites] = React5.useState([]);
9342
+ const [loadingInvites, setLoadingInvites] = React5.useState(false);
9343
+ const [activeTab, setActiveTab] = React5.useState(defaultView);
9344
+ const loadInvites = React5.useCallback(async () => {
9345
+ if (!open || !effectiveSlug) return;
9346
+ setLoadingInvites(true);
9347
+ try {
9348
+ const data = await gql(
9349
+ "workspaces",
9350
+ GET_SENT_INVITES,
9351
+ { workspaceSlug: effectiveSlug }
9352
+ );
9353
+ setSentInvites(data?.sentWorkspaceInvites || []);
9354
+ } catch (err) {
9355
+ console.error("Failed to load sent invites", err);
9356
+ } finally {
9357
+ setLoadingInvites(false);
9358
+ }
9359
+ }, [open, effectiveSlug, gql]);
9326
9360
  React5.useEffect(() => {
9327
9361
  if (open) {
9328
9362
  setEmail("");
9329
9363
  setRole("MEMBER");
9330
9364
  setError("");
9365
+ setActiveTab(defaultView);
9366
+ loadInvites();
9331
9367
  }
9332
- }, [open]);
9368
+ }, [open, loadInvites, defaultView]);
9333
9369
  const handleSubmit = async (e) => {
9334
9370
  e.preventDefault();
9335
9371
  const trimmed = email.trim().toLowerCase();
@@ -9355,7 +9391,9 @@ function InviteMemberDialog({
9355
9391
  );
9356
9392
  onOpenChange(false);
9357
9393
  onInvited?.(data.inviteWorkspaceMember);
9358
- toast.success(`Convite enviado para ${trimmed}`);
9394
+ toast.success(`Convite enviado para ${trimmed} `);
9395
+ loadInvites();
9396
+ setEmail("");
9359
9397
  } catch (err) {
9360
9398
  const msg = err.message || "Failed to send invite";
9361
9399
  setError(msg);
@@ -9384,55 +9422,91 @@ function InviteMemberDialog({
9384
9422
  loading ? "Sending\u2026" : "Send Invite"
9385
9423
  ] })
9386
9424
  ] }),
9387
- children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
9388
- /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
9389
- /* @__PURE__ */ jsx(Label, { htmlFor: "invite-email", children: "Email address" }),
9390
- /* @__PURE__ */ jsx(
9391
- Input,
9392
- {
9393
- id: "invite-email",
9394
- type: "email",
9395
- placeholder: "colleague@company.com",
9396
- value: email,
9397
- onChange: (e) => {
9398
- setEmail(e.target.value);
9399
- setError("");
9400
- },
9401
- autoFocus: true
9402
- }
9403
- ),
9404
- error && /* @__PURE__ */ jsx("p", { className: "text-xs text-rose-400", children: error })
9425
+ children: /* @__PURE__ */ jsxs(Tabs, { value: activeTab, onValueChange: setActiveTab, className: "w-full", children: [
9426
+ /* @__PURE__ */ jsxs(TabsList, { className: "grid grid-cols-2 mb-4", children: [
9427
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "invite", children: "Convidar" }),
9428
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "sent", children: "Enviados" })
9405
9429
  ] }),
9406
- /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
9407
- /* @__PURE__ */ jsx(Label, { children: "Role" }),
9408
- /* @__PURE__ */ jsx("div", { className: "space-y-2", children: roles.map((r) => /* @__PURE__ */ jsxs(
9409
- "button",
9410
- {
9411
- type: "button",
9412
- onClick: () => setRole(r.value),
9413
- className: cn(
9414
- "w-full flex items-center gap-3 p-2.5 rounded-xl border text-left transition-all",
9415
- role === r.value ? "bg-theme-subtle-10 border-primary ring-1 ring-primary/30" : "bg-theme-card border-theme-subtle hover:border-theme-medium"
9416
- ),
9417
- children: [
9418
- /* @__PURE__ */ jsx(
9419
- "div",
9420
- {
9421
- className: cn(
9422
- "w-3 h-3 rounded-full border-2",
9423
- role === r.value ? "bg-primary border-primary" : "border-theme-subtle-20"
9424
- )
9425
- }
9430
+ /* @__PURE__ */ jsx(TabsContent, { value: "invite", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
9431
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
9432
+ /* @__PURE__ */ jsx(Label, { htmlFor: "invite-email", children: "Endere\xE7o de Email" }),
9433
+ /* @__PURE__ */ jsx(
9434
+ Input,
9435
+ {
9436
+ id: "invite-email",
9437
+ type: "email",
9438
+ placeholder: "colega@empresa.com",
9439
+ value: email,
9440
+ onChange: (e) => {
9441
+ setEmail(e.target.value);
9442
+ setError("");
9443
+ },
9444
+ autoFocus: true
9445
+ }
9446
+ ),
9447
+ error && /* @__PURE__ */ jsx("p", { className: "text-xs text-rose-400", children: error })
9448
+ ] }),
9449
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
9450
+ /* @__PURE__ */ jsx(Label, { children: "Papel" }),
9451
+ /* @__PURE__ */ jsx("div", { className: "space-y-2", children: roles.map((r) => /* @__PURE__ */ jsxs(
9452
+ "button",
9453
+ {
9454
+ type: "button",
9455
+ onClick: () => setRole(r.value),
9456
+ className: cn(
9457
+ "w-full flex items-center gap-3 p-2.5 rounded-xl border text-left transition-all",
9458
+ role === r.value ? "bg-theme-subtle-10 border-primary ring-1 ring-primary/30" : "bg-theme-card border-theme-subtle hover:border-theme-medium"
9426
9459
  ),
9427
- /* @__PURE__ */ jsxs("div", { children: [
9428
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-theme", children: r.label }),
9429
- /* @__PURE__ */ jsx("p", { className: "text-xs text-theme-muted", children: r.desc })
9460
+ children: [
9461
+ /* @__PURE__ */ jsx(
9462
+ "div",
9463
+ {
9464
+ className: cn(
9465
+ "w-3 h-3 rounded-full border-2",
9466
+ role === r.value ? "bg-primary border-primary" : "border-theme-subtle-20"
9467
+ )
9468
+ }
9469
+ ),
9470
+ /* @__PURE__ */ jsxs("div", { children: [
9471
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-theme", children: r.label }),
9472
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-theme-muted", children: r.desc })
9473
+ ] })
9474
+ ]
9475
+ },
9476
+ r.value
9477
+ )) })
9478
+ ] })
9479
+ ] }) }),
9480
+ /* @__PURE__ */ jsx(TabsContent, { value: "sent", children: /* @__PURE__ */ jsx("div", { className: "space-y-3 min-h-[200px]", children: loadingInvites ? /* @__PURE__ */ jsx("p", { className: "text-xs text-theme-muted text-center pt-8", children: "Carregando..." }) : sentInvites.length > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-2 max-h-60 overflow-y-auto pr-1", children: sentInvites.map((inv) => /* @__PURE__ */ jsxs(
9481
+ "div",
9482
+ {
9483
+ className: "flex items-center justify-between p-2.5 rounded-xl border bg-theme-card text-sm border-theme-subtle",
9484
+ children: [
9485
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-0", children: [
9486
+ /* @__PURE__ */ jsx("span", { className: "truncate font-medium text-theme", children: inv.email }),
9487
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-theme-muted", children: [
9488
+ inv.role,
9489
+ " ",
9490
+ inv.workspace?.name ? `\u2022 ${inv.workspace.name}` : ""
9430
9491
  ] })
9431
- ]
9432
- },
9433
- r.value
9434
- )) })
9435
- ] })
9492
+ ] }),
9493
+ /* @__PURE__ */ jsx("div", { className: "shrink-0 ml-2", children: /* @__PURE__ */ jsx(
9494
+ "span",
9495
+ {
9496
+ className: cn(
9497
+ "px-2.5 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider",
9498
+ inv.status === "PENDING" ? "bg-amber-100 text-amber-700" : inv.status === "ACCEPTED" ? "bg-emerald-100 text-emerald-700" : "bg-slate-100 text-slate-700 text-theme-muted"
9499
+ ),
9500
+ children: inv.status
9501
+ }
9502
+ ) })
9503
+ ]
9504
+ },
9505
+ inv.id
9506
+ )) }) : /* @__PURE__ */ jsxs("div", { className: "text-center pt-8 space-y-2", children: [
9507
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-theme-muted", children: "Nenhum convite enviado ainda." }),
9508
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => setActiveTab("invite"), children: "Convidar agora" })
9509
+ ] }) }) })
9436
9510
  ] })
9437
9511
  }
9438
9512
  );