@burdenoff/microfe-workspaces 2026.1123.3 → 2026.1129.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,17 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
- import { getProjectDisplayNames as t, getRoleDisplayNames as n, getWorkspaceDisplayName as r } from "../utils/invitationDisplay.js";
3
- import { useWorkspacesContext as i } from "../providers/WorkspacesProvider.js";
4
- import { useAcceptInvitation as a, useRejectInvitation as o } from "../hooks/useMemberMutations.js";
5
- import { useMyPendingInvitations as s } from "../hooks/usePendingInvitations.js";
6
- import { useWorkspacesPageView as c } from "../hooks/useWorkspacesPageView.js";
2
+ import { getProjectDisplayNames as t, getRoleDisplayNames as ee, getWorkspaceDisplayName as n } from "../utils/invitationDisplay.js";
3
+ import { useWorkspacesContext as r } from "../providers/WorkspacesProvider.js";
4
+ import { useAcceptInvitation as i, useRejectInvitation as a } from "../hooks/useMemberMutations.js";
5
+ import { useMyPendingInvitations as o } from "../hooks/usePendingInvitations.js";
6
+ import { useWorkspacesPageView as s } from "../hooks/useWorkspacesPageView.js";
7
+ import { CompactMarkOr as c } from "../components/loadingSystem.js";
7
8
  import { useMemo as l, useState as u } from "react";
8
- import { AlertTriangle as d, CheckCircle as f, Home as p, Mail as m, RefreshCw as h, XCircle as g } from "lucide-react";
9
- import { Badge as _, Button as v, GlassCard as y, IllustratedEmptyState as b, PageContainer as x, PagePurpose as S, Skeleton as C } from "@burdenoff/fe-libs/ui";
10
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
11
- import { useI18n as E } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { useNavigate as D } from "react-router";
9
+ import { AlertTriangle as d, CheckCircle as f, Home as p, Mail as te, RefreshCw as m, XCircle as h } from "lucide-react";
10
+ import { Badge as g, Button as _, GlassCard as v, IllustratedEmptyState as y, PageContainer as b, PagePurpose as x, Skeleton as S } from "@burdenoff/fe-libs/ui";
11
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
12
+ import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
+ import { useNavigate as E } from "react-router";
14
+ import { useLoadingSystem as D } from "@burdenoff/fe-libs/ui/loading/LoadingSystemProvider";
13
15
  import { ActorIdentity as O, useActorProfiles as k } from "@burdenoff/fe-libs/shared";
14
16
  // src/pages/PendingInvitesPage.tsx
15
17
  function A(e) {
@@ -24,223 +26,232 @@ function A(e) {
24
26
  });
25
27
  }
26
28
  function j() {
27
- c("workspaces.pending-invites");
28
- let { t: j } = E(), M = D(), { currentUser: N, authToken: P, apiGatewayUrl: F, organizationId: I, basePath: L = "/workspaces" } = i(), [R, z] = u(null), [B, V] = u(null), { data: H = [], isLoading: U, error: W } = s(N?.email), G = l(() => [...H].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()), [H]), K = l(() => G.flatMap((e) => e.invitedById ? [{
29
+ let j = D();
30
+ s("workspaces.pending-invites");
31
+ let { t: M } = T(), ne = E(), { currentUser: N, authToken: P, apiGatewayUrl: F, organizationId: I, basePath: L = "/workspaces" } = r(), [R, z] = u(null), [B, V] = u(null), { data: H = [], isLoading: U, error: W } = o(N?.email), G = l(() => [...H].sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime()), [H]), K = l(() => G.flatMap((e) => e.invitedById ? [{
29
32
  actorId: e.invitedById,
30
33
  actorType: "user"
31
34
  }] : []), [G]), q = k(K, {
32
35
  apiGatewayUrl: F,
33
36
  authToken: P,
34
37
  orgId: I
35
- }), { mutate: J, isPending: Y } = a(), { mutate: X, isPending: Z } = o(), Q = Y || Z, $ = () => {
36
- M(`${L}/list`);
37
- }, ee = (t) => {
38
+ }), { mutate: J, isPending: Y } = i(), { mutate: X, isPending: Z } = a(), Q = Y || Z, $ = () => {
39
+ ne(`${L}/list`);
40
+ }, re = (t) => {
38
41
  z(t), V(null), J(t, {
39
42
  onSuccess: () => {
40
43
  z(null);
41
44
  },
42
45
  onError: (t) => {
43
- z(null), V(t instanceof Error ? t.message : e(j, "pendingInvites.acceptError", "Failed to accept invitation"));
46
+ z(null), V(t instanceof Error ? t.message : e(M, "pendingInvites.acceptError", "Failed to accept invitation"));
44
47
  }
45
48
  });
46
- }, te = (t) => {
49
+ }, ie = (t) => {
47
50
  z(t), V(null), X(t, {
48
51
  onSuccess: () => {
49
52
  z(null);
50
53
  },
51
54
  onError: (t) => {
52
- z(null), V(t instanceof Error ? t.message : e(j, "pendingInvites.rejectError", "Failed to reject invitation"));
55
+ z(null), V(t instanceof Error ? t.message : e(M, "pendingInvites.rejectError", "Failed to reject invitation"));
53
56
  }
54
57
  });
55
58
  };
56
- return !P || !N?.email ? /* @__PURE__ */ w(x, {
59
+ return !P || !N?.email ? /* @__PURE__ */ C(b, {
57
60
  padded: !1,
58
- children: /* @__PURE__ */ w("div", {
61
+ children: /* @__PURE__ */ C("div", {
59
62
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
60
- children: /* @__PURE__ */ T("div", {
63
+ children: /* @__PURE__ */ w("div", {
61
64
  className: "rounded-lg border border-border-seam bg-bg-surface p-6 text-center",
62
65
  children: [
63
- /* @__PURE__ */ w(d, { className: "mx-auto mb-3 size-10 text-text-secondary" }),
64
- /* @__PURE__ */ w("h1", {
66
+ /* @__PURE__ */ C(d, { className: "mx-auto mb-3 size-10 text-text-secondary" }),
67
+ /* @__PURE__ */ C("h1", {
65
68
  className: "text-2xl font-bold",
66
- children: e(j, "pendingInvites.signInTitle", "Sign in to view your pending invites")
69
+ children: e(M, "pendingInvites.signInTitle", "Sign in to view your pending invites")
67
70
  }),
68
- /* @__PURE__ */ w("p", {
71
+ /* @__PURE__ */ C("p", {
69
72
  className: "mt-2 text-text-secondary",
70
- children: e(j, "pendingInvites.signInDescription", "You need an authenticated account before you can review or respond to workspace invitations.")
73
+ children: e(M, "pendingInvites.signInDescription", "You need an authenticated account before you can review or respond to workspace invitations.")
71
74
  }),
72
- /* @__PURE__ */ w("div", {
75
+ /* @__PURE__ */ C("div", {
73
76
  className: "mt-4 flex justify-center",
74
- children: /* @__PURE__ */ T(v, {
77
+ children: /* @__PURE__ */ w(_, {
75
78
  onClick: $,
76
79
  variant: "outline",
77
- children: [/* @__PURE__ */ w(p, { className: "mr-2 size-4" }), e(j, "pendingInvites.backToWorkspaces", "Back to Workspaces")]
80
+ children: [/* @__PURE__ */ C(p, { className: "mr-2 size-4" }), e(M, "pendingInvites.backToWorkspaces", "Back to Workspaces")]
78
81
  })
79
82
  })
80
83
  ]
81
84
  })
82
85
  })
83
- }) : /* @__PURE__ */ w(x, {
86
+ }) : /* @__PURE__ */ C(b, {
84
87
  padded: !1,
85
- children: /* @__PURE__ */ T("div", {
88
+ children: /* @__PURE__ */ w("div", {
86
89
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
87
90
  children: [
88
- /* @__PURE__ */ T("div", {
91
+ /* @__PURE__ */ w("div", {
89
92
  className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
90
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h1", {
93
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h1", {
91
94
  className: "text-2xl sm:text-3xl font-bold",
92
- children: e(j, "pendingInvites.pageTitle", "Pending Invites")
93
- }), /* @__PURE__ */ w("p", {
95
+ children: e(M, "pendingInvites.pageTitle", "Pending Invites")
96
+ }), /* @__PURE__ */ C("p", {
94
97
  className: "text-sm sm:text-base text-text-secondary",
95
- children: e(j, "pendingInvites.pageSubtitle", "Review and respond to workspace invitations sent to your account.")
96
- })] }), /* @__PURE__ */ T("div", {
98
+ children: e(M, "pendingInvites.pageSubtitle", "Review and respond to workspace invitations sent to your account.")
99
+ })] }), /* @__PURE__ */ w("div", {
97
100
  className: "flex items-center gap-2",
98
- children: [/* @__PURE__ */ w(_, {
101
+ children: [/* @__PURE__ */ C(g, {
99
102
  variant: "secondary",
100
103
  children: G.length
101
- }), /* @__PURE__ */ T(v, {
104
+ }), /* @__PURE__ */ w(_, {
102
105
  variant: "outline",
103
106
  onClick: $,
104
- children: [/* @__PURE__ */ w(p, { className: "mr-2 size-4" }), e(j, "pendingInvites.viewWorkspaces", "View Workspaces")]
107
+ children: [/* @__PURE__ */ C(p, { className: "mr-2 size-4" }), e(M, "pendingInvites.viewWorkspaces", "View Workspaces")]
105
108
  })]
106
109
  })]
107
110
  }),
108
- /* @__PURE__ */ w(S, { children: e(j, "pendingInvites.purpose", "These are workspace invitations sent to your email but not yet answered. Accepting one adds you to that workspace (with the roles and project access shown); rejecting declines it. Invitations expire, so respond to the ones you want before their expiry date.") }),
109
- B ? /* @__PURE__ */ T("div", {
111
+ /* @__PURE__ */ C(x, { children: e(M, "pendingInvites.purpose", "These are workspace invitations sent to your email but not yet answered. Accepting one adds you to that workspace (with the roles and project access shown); rejecting declines it. Invitations expire, so respond to the ones you want before their expiry date.") }),
112
+ B ? /* @__PURE__ */ w("div", {
110
113
  className: "flex items-start gap-2 rounded-lg border border-status-error-border/30 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
111
- children: [/* @__PURE__ */ w(d, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ w("span", { children: B })]
114
+ children: [/* @__PURE__ */ C(d, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ C("span", { children: B })]
112
115
  }) : null,
113
- W ? /* @__PURE__ */ w("div", {
116
+ W ? /* @__PURE__ */ C("div", {
114
117
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
115
- children: W instanceof Error ? W.message : e(j, "pendingInvites.loadError", "Failed to load pending invitations")
118
+ children: W instanceof Error ? W.message : e(M, "pendingInvites.loadError", "Failed to load pending invitations")
116
119
  }) : null,
117
- U ? /* @__PURE__ */ w("div", {
120
+ U ? /* @__PURE__ */ C("div", {
118
121
  className: "space-y-4",
119
- children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ T("div", {
122
+ children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ w("div", {
120
123
  className: "rounded-lg border border-border-seam bg-bg-surface p-5 space-y-3",
121
124
  children: [
122
- /* @__PURE__ */ w(C, { className: "h-5 w-40" }),
123
- /* @__PURE__ */ w(C, { className: "h-4 w-64" }),
124
- /* @__PURE__ */ w(C, { className: "h-4 w-52" }),
125
- /* @__PURE__ */ T("div", {
125
+ /* @__PURE__ */ C(S, { className: "h-5 w-40" }),
126
+ /* @__PURE__ */ C(S, { className: "h-4 w-64" }),
127
+ /* @__PURE__ */ C(S, { className: "h-4 w-52" }),
128
+ /* @__PURE__ */ w("div", {
126
129
  className: "flex gap-2 pt-2",
127
- children: [/* @__PURE__ */ w(C, { className: "h-10 w-36" }), /* @__PURE__ */ w(C, { className: "h-10 w-28" })]
130
+ children: [/* @__PURE__ */ C(S, { className: "h-10 w-36" }), /* @__PURE__ */ C(S, { className: "h-10 w-28" })]
128
131
  })
129
132
  ]
130
133
  }, t))
131
- }) : G.length === 0 ? /* @__PURE__ */ w(b, {
134
+ }) : G.length === 0 ? /* @__PURE__ */ C(y, {
132
135
  illustration: "empty-notifications",
133
- title: e(j, "pendingInvites.emptyTitle", "No pending invites"),
134
- description: e(j, "pendingInvites.emptyDescription", "When someone invites you to a workspace, it will appear here."),
136
+ title: e(M, "pendingInvites.emptyTitle", "No pending invites"),
137
+ description: e(M, "pendingInvites.emptyDescription", "When someone invites you to a workspace, it will appear here."),
135
138
  kind: "all-done"
136
- }) : /* @__PURE__ */ w("div", {
139
+ }) : /* @__PURE__ */ C("div", {
137
140
  className: "space-y-4",
138
- children: G.map((i, a) => {
139
- let o = i.invitedById ? q[i.invitedById] : void 0, s = o?.displayName || o?.email || i.invitedById || "—", c = A(i.expiresAt), l = A(i.createdAt), u = r(i), d = n(i), p = t(i), b = R === i.id && Q;
140
- return /* @__PURE__ */ w(y, {
141
+ children: G.map((r, i) => {
142
+ let a = r.invitedById ? q[r.invitedById] : void 0, o = a?.displayName || a?.email || r.invitedById || "—", s = A(r.expiresAt), l = A(r.createdAt), u = n(r), d = ee(r), p = t(r), y = R === r.id && Q;
143
+ return /* @__PURE__ */ C(v, {
141
144
  treatment: "insight",
142
- glow: a === 0,
145
+ glow: i === 0,
143
146
  className: "border-border-seam p-5",
144
- children: /* @__PURE__ */ T("div", {
147
+ children: /* @__PURE__ */ w("div", {
145
148
  className: "flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",
146
- children: [/* @__PURE__ */ T("div", {
149
+ children: [/* @__PURE__ */ w("div", {
147
150
  className: "space-y-3 min-w-0",
148
151
  children: [
149
- /* @__PURE__ */ T("div", {
152
+ /* @__PURE__ */ w("div", {
150
153
  className: "flex flex-wrap items-center gap-2",
151
- children: [/* @__PURE__ */ T("div", {
154
+ children: [/* @__PURE__ */ w("div", {
152
155
  className: "flex items-center gap-2 font-semibold text-lg",
153
- children: [/* @__PURE__ */ w(m, { className: "size-4 text-primary" }), /* @__PURE__ */ w("span", { children: i.email })]
154
- }), /* @__PURE__ */ w(_, {
156
+ children: [/* @__PURE__ */ C(te, { className: "size-4 text-primary" }), /* @__PURE__ */ C("span", { children: r.email })]
157
+ }), /* @__PURE__ */ C(g, {
155
158
  variant: "secondary",
156
- children: i.status
159
+ children: r.status
157
160
  })]
158
161
  }),
159
- /* @__PURE__ */ T("dl", {
162
+ /* @__PURE__ */ w("dl", {
160
163
  className: "grid gap-2 text-sm text-text-secondary sm:grid-cols-2",
161
164
  children: [
162
- /* @__PURE__ */ T("div", { children: [
163
- /* @__PURE__ */ w("dt", {
165
+ /* @__PURE__ */ w("div", { children: [
166
+ /* @__PURE__ */ C("dt", {
164
167
  className: "font-medium text-text-primary",
165
- children: e(j, "pendingInvites.workspaceLabel", "Workspace")
168
+ children: e(M, "pendingInvites.workspaceLabel", "Workspace")
166
169
  }),
167
- /* @__PURE__ */ w("dd", {
170
+ /* @__PURE__ */ C("dd", {
168
171
  className: "break-words font-medium text-text-primary",
169
172
  children: u
170
173
  }),
171
- i.workspaceId ? /* @__PURE__ */ w("dd", {
174
+ r.workspaceId ? /* @__PURE__ */ C("dd", {
172
175
  className: "mt-1 break-all font-mono text-xs text-text-secondary",
173
- children: i.workspaceId
176
+ children: r.workspaceId
174
177
  }) : null
175
178
  ] }),
176
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
179
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("dt", {
177
180
  className: "font-medium text-text-primary",
178
- children: e(j, "pendingInvites.invitedByLabel", "Invited by")
179
- }), /* @__PURE__ */ w("dd", {
181
+ children: e(M, "pendingInvites.invitedByLabel", "Invited by")
182
+ }), /* @__PURE__ */ C("dd", {
180
183
  className: "break-all",
181
- children: o ? /* @__PURE__ */ w(O, {
182
- profile: o,
184
+ children: a ? /* @__PURE__ */ C(O, {
185
+ profile: a,
183
186
  variant: "inline",
184
187
  hideIdDrilldown: !0
185
- }) : /* @__PURE__ */ w("span", {
188
+ }) : /* @__PURE__ */ C("span", {
186
189
  className: "font-medium text-text-primary",
187
- children: s
190
+ children: o
188
191
  })
189
192
  })] }),
190
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
193
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("dt", {
191
194
  className: "font-medium text-text-primary",
192
- children: e(j, "pendingInvites.receivedLabel", "Received")
193
- }), /* @__PURE__ */ w("dd", { children: l ?? "—" })] }),
194
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
195
+ children: e(M, "pendingInvites.receivedLabel", "Received")
196
+ }), /* @__PURE__ */ C("dd", { children: l ?? "—" })] }),
197
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("dt", {
195
198
  className: "font-medium text-text-primary",
196
- children: e(j, "pendingInvites.expiresLabel", "Expires")
197
- }), /* @__PURE__ */ w("dd", { children: c ?? "—" })] })
199
+ children: e(M, "pendingInvites.expiresLabel", "Expires")
200
+ }), /* @__PURE__ */ C("dd", { children: s ?? "—" })] })
198
201
  ]
199
202
  }),
200
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
203
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
201
204
  className: "text-sm font-medium text-text-primary mb-2",
202
- children: e(j, "pendingInvites.rolesLabel", "Roles")
203
- }), /* @__PURE__ */ w("div", {
205
+ children: e(M, "pendingInvites.rolesLabel", "Roles")
206
+ }), /* @__PURE__ */ C("div", {
204
207
  className: "flex flex-wrap gap-2",
205
- children: d.length > 0 ? d.map((e, t) => /* @__PURE__ */ w(_, {
208
+ children: d.length > 0 ? d.map((e, t) => /* @__PURE__ */ C(g, {
206
209
  variant: "outline",
207
210
  children: e
208
- }, `${i.id}-${i.roleIds[t] ?? e}`)) : /* @__PURE__ */ w("span", {
211
+ }, `${r.id}-${r.roleIds[t] ?? e}`)) : /* @__PURE__ */ C("span", {
209
212
  className: "text-sm text-text-secondary",
210
- children: e(j, "pendingInvites.noRoles", "No explicit roles assigned")
213
+ children: e(M, "pendingInvites.noRoles", "No explicit roles assigned")
211
214
  })
212
215
  })] }),
213
- /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
216
+ /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
214
217
  className: "text-sm font-medium text-text-primary mb-2",
215
- children: e(j, "pendingInvites.projectsLabel", "Projects")
216
- }), /* @__PURE__ */ w("div", {
218
+ children: e(M, "pendingInvites.projectsLabel", "Projects")
219
+ }), /* @__PURE__ */ C("div", {
217
220
  className: "flex flex-wrap gap-2",
218
- children: p.length > 0 ? p.map((e, t) => /* @__PURE__ */ w(_, {
221
+ children: p.length > 0 ? p.map((e, t) => /* @__PURE__ */ C(g, {
219
222
  variant: "secondary",
220
223
  children: e
221
- }, `${i.id}-project-${e}-${t}`)) : /* @__PURE__ */ w("span", {
224
+ }, `${r.id}-project-${e}-${t}`)) : /* @__PURE__ */ C("span", {
222
225
  className: "text-sm text-text-secondary",
223
- children: e(j, "pendingInvites.noProjects", "No project access will be granted automatically")
226
+ children: e(M, "pendingInvites.noProjects", "No project access will be granted automatically")
224
227
  })
225
228
  })] })
226
229
  ]
227
- }), /* @__PURE__ */ T("div", {
230
+ }), /* @__PURE__ */ w("div", {
228
231
  className: "flex flex-col gap-2 sm:flex-row lg:flex-col lg:min-w-44",
229
- children: [/* @__PURE__ */ T(v, {
230
- onClick: () => ee(i.id),
232
+ children: [/* @__PURE__ */ w(_, {
233
+ busy: j && y && Y,
234
+ onClick: () => re(r.id),
231
235
  disabled: Q,
232
236
  className: "w-full",
233
- children: [b && Y ? /* @__PURE__ */ w(h, { className: "mr-2 size-4 animate-spin" }) : /* @__PURE__ */ w(f, { className: "mr-2 size-4" }), e(j, "pendingInvites.acceptButton", "Accept")]
234
- }), /* @__PURE__ */ T(v, {
237
+ children: [!j && y && Y ? /* @__PURE__ */ C(c, {
238
+ className: "mr-2 size-4",
239
+ today: /* @__PURE__ */ C(m, { className: "mr-2 size-4 animate-spin" })
240
+ }) : /* @__PURE__ */ C(f, { className: "mr-2 size-4" }), e(M, "pendingInvites.acceptButton", "Accept")]
241
+ }), /* @__PURE__ */ w(_, {
242
+ busy: j && y && Z,
235
243
  variant: "outline",
236
- onClick: () => te(i.id),
244
+ onClick: () => ie(r.id),
237
245
  disabled: Q,
238
246
  className: "w-full",
239
- children: [b && Z ? /* @__PURE__ */ w(h, { className: "mr-2 size-4 animate-spin" }) : /* @__PURE__ */ w(g, { className: "mr-2 size-4" }), e(j, "pendingInvites.rejectButton", "Reject")]
247
+ children: [!j && y && Z ? /* @__PURE__ */ C(c, {
248
+ className: "mr-2 size-4",
249
+ today: /* @__PURE__ */ C(m, { className: "mr-2 size-4 animate-spin" })
250
+ }) : /* @__PURE__ */ C(h, { className: "mr-2 size-4" }), e(M, "pendingInvites.rejectButton", "Reject")]
240
251
  })]
241
252
  })]
242
253
  })
243
- }, i.id);
254
+ }, r.id);
244
255
  })
245
256
  })
246
257
  ]