@burdenoff/microfe-workspaces 2026.1113.1 → 2026.1114.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.
- package/dist/WorkspacesRoot.js +31 -25
- package/dist/components/CreateProjectDialog.js +81 -78
- package/dist/components/CreateWorkspaceDialog.js +41 -41
- package/dist/components/InviteMemberDialog.js +54 -54
- package/dist/components/MemberListItem.js +53 -53
- package/dist/components/ProjectCard.js +82 -82
- package/dist/components/ProjectMemberPickerDialog.js +46 -46
- package/dist/components/RenameProjectDialog.js +16 -16
- package/dist/components/WorkspaceCard.js +18 -18
- package/dist/components/WorkspacesErrorBoundary.js +25 -25
- package/dist/components/tags/ProjectTagsWidget.js +50 -50
- package/dist/components/tags/WorkspaceTagsEditor.js +9 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -14
- package/dist/pages/ActivityListPage.js +30 -30
- package/dist/pages/CreateWorkspacePage.js +205 -173
- package/dist/pages/InviteAcceptancePage.js +201 -201
- package/dist/pages/MembersListPage.js +165 -164
- package/dist/pages/PendingInvitesPage.js +67 -67
- package/dist/pages/ProjectDetailPage.js +297 -272
- package/dist/pages/ProjectMembersPage.js +59 -59
- package/dist/pages/ProjectsListPage.js +275 -244
- package/dist/pages/WorkspaceDetailPage.js +175 -172
- package/dist/pages/WorkspaceInvitePage.js +298 -298
- package/dist/pages/WorkspaceSettingsPage.js +48 -48
- package/dist/pages/WorkspacesListPage.js +55 -55
- package/dist/pages/dashboard/DashboardCustomizer.js +27 -27
- package/dist/pages/dashboard/DashboardPage.js +35 -35
- package/dist/pages/dashboard/WidgetWrapper.js +21 -21
- package/dist/pages/dashboard/widgets/AgentsWidget.js +25 -25
- package/dist/pages/dashboard/widgets/GroupsWidget.js +14 -14
- package/dist/pages/dashboard/widgets/MembersWidget.js +15 -15
- package/dist/pages/dashboard/widgets/ProjectsWidget.js +20 -20
- package/dist/pages/dashboard/widgets/QuickActionsWidget.js +7 -7
- package/dist/pages/dashboard/widgets/RecentActivityWidget.js +16 -16
- package/dist/pages/dashboard/widgets/SessionsWidget.js +15 -15
- package/dist/pages/dashboard/widgets/TagCloudWidget.js +11 -11
- package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js +16 -16
- package/dist/pages/dashboard/widgets/VibesWidget.js +13 -13
- package/dist/pages/dashboard/widgets/WelcomeWidget.js +23 -23
- package/dist/pages/dashboard/widgets/WorkflowRunsWidget.js +26 -26
- package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +21 -21
- package/dist/pages/dashboard/widgets/WorkflowsOverviewWidget.js +22 -22
- package/dist/pages/dashboard/widgets/WorkspacesWidget.js +16 -16
- package/dist/providers/WorkspacesProvider.d.ts +5 -0
- package/dist/providers/WorkspacesProvider.js +2 -2
- package/dist/types/index.d.ts +11 -1
- package/dist/utils/createForms.d.ts +21 -0
- package/dist/utils/createForms.js +20 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -3,8 +3,8 @@ import { useWorkspacePermissions as t } from "../hooks/useWorkspacePermissions.j
|
|
|
3
3
|
import { useWorkspacesPageView as n } from "../hooks/useWorkspacesPageView.js";
|
|
4
4
|
import { formatDate as r } from "../utils/formatters.js";
|
|
5
5
|
import { tWithFallback as i } from "../utils/i18n.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { CardContent as a, CardHeader as o, CardTitle as s, GlassCard as c, IllustratedEmptyState as l, PagePurpose as u, Skeleton as d } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
9
|
import { useParams as h } from "react-router";
|
|
10
10
|
// src/pages/ActivityListPage.tsx
|
|
@@ -15,84 +15,84 @@ function g() {
|
|
|
15
15
|
requireParams: !0
|
|
16
16
|
});
|
|
17
17
|
let { data: v, isLoading: y, error: b } = e(_), { canViewActivity: x, isLoading: S } = t();
|
|
18
|
-
return S ? /* @__PURE__ */
|
|
18
|
+
return S ? /* @__PURE__ */ p("div", {
|
|
19
19
|
className: "space-y-4 p-6",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
}) : x ? /* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ f(d, { className: "h-10 w-1/3" }), /* @__PURE__ */ f(d, { className: "h-64" })]
|
|
21
|
+
}) : x ? /* @__PURE__ */ p("div", {
|
|
22
22
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
|
|
25
25
|
className: "text-2xl sm:text-3xl font-bold",
|
|
26
26
|
children: i(g, "activityList.title", "Activity")
|
|
27
|
-
}), /* @__PURE__ */
|
|
27
|
+
}), /* @__PURE__ */ f("p", {
|
|
28
28
|
className: "text-text-secondary",
|
|
29
29
|
children: i(g, "activityList.description", "Track workspace activity")
|
|
30
30
|
})] }),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
y ? /* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ f(u, { children: i(g, "activityList.purpose", "This is the audit trail for the workspace — a running log of who did what and when. Use it to catch up after time away, confirm a change went through, or investigate when and by whom a project or member was modified.") }),
|
|
32
|
+
y ? /* @__PURE__ */ f(c, {
|
|
33
33
|
treatment: "plain",
|
|
34
34
|
className: "border-border-seam",
|
|
35
|
-
children: /* @__PURE__ */ a
|
|
35
|
+
children: /* @__PURE__ */ f(a, {
|
|
36
36
|
className: "py-8 text-sm text-text-muted",
|
|
37
37
|
children: i(g, "activityList.loading", "Loading activity…")
|
|
38
38
|
})
|
|
39
|
-
}) : b ? /* @__PURE__ */
|
|
39
|
+
}) : b ? /* @__PURE__ */ f(c, {
|
|
40
40
|
treatment: "plain",
|
|
41
41
|
className: "border-border-seam",
|
|
42
|
-
children: /* @__PURE__ */ a
|
|
42
|
+
children: /* @__PURE__ */ f(a, {
|
|
43
43
|
className: "py-8 text-sm text-status-error-text",
|
|
44
44
|
children: b instanceof Error ? b.message : i(g, "activityList.loadError", "Failed to load activity")
|
|
45
45
|
})
|
|
46
|
-
}) : (v?.length ?? 0) === 0 ? /* @__PURE__ */
|
|
46
|
+
}) : (v?.length ?? 0) === 0 ? /* @__PURE__ */ f(l, {
|
|
47
47
|
illustration: "empty-data",
|
|
48
48
|
title: i(g, "activityList.emptyTitle", "No recent activity"),
|
|
49
49
|
description: i(g, "activityList.emptyDescription", "Recent workspace actions will appear here as your team creates, updates, and manages work.")
|
|
50
|
-
}) : /* @__PURE__ */
|
|
50
|
+
}) : /* @__PURE__ */ f("div", {
|
|
51
51
|
className: "space-y-3",
|
|
52
|
-
children: v?.map((e) => /* @__PURE__ */
|
|
52
|
+
children: v?.map((e) => /* @__PURE__ */ p(c, {
|
|
53
53
|
treatment: "insight",
|
|
54
54
|
className: "border-border-seam",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ f(o, {
|
|
56
56
|
className: "pb-2",
|
|
57
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ f(s, {
|
|
58
58
|
className: "text-base",
|
|
59
59
|
children: e.description || e.action
|
|
60
60
|
})
|
|
61
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ p(a, {
|
|
62
62
|
className: "space-y-1 text-sm text-text-muted",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ p("p", { children: [
|
|
65
65
|
i(g, "activityList.labelAction", "Action"),
|
|
66
66
|
":",
|
|
67
67
|
" ",
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ f("span", {
|
|
69
69
|
className: "text-text-primary",
|
|
70
70
|
children: e.action
|
|
71
71
|
})
|
|
72
72
|
] }),
|
|
73
|
-
e.resourceType && /* @__PURE__ */
|
|
73
|
+
e.resourceType && /* @__PURE__ */ p("p", { children: [
|
|
74
74
|
i(g, "activityList.labelResource", "Resource"),
|
|
75
75
|
":",
|
|
76
76
|
" ",
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ f("span", {
|
|
78
78
|
className: "text-text-primary",
|
|
79
79
|
children: e.resourceType
|
|
80
80
|
})
|
|
81
81
|
] }),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ p("p", { children: [
|
|
83
83
|
i(g, "activityList.labelWhen", "When"),
|
|
84
84
|
":",
|
|
85
85
|
" ",
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ f("span", {
|
|
87
87
|
className: "text-text-primary",
|
|
88
88
|
children: r(e.timestamp)
|
|
89
89
|
})
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ p("p", { children: [
|
|
92
92
|
i(g, "activityList.labelActor", "Actor"),
|
|
93
93
|
":",
|
|
94
94
|
" ",
|
|
95
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ f("span", {
|
|
96
96
|
className: "break-all text-text-primary",
|
|
97
97
|
children: e.userId
|
|
98
98
|
})
|
|
@@ -102,14 +102,14 @@ function g() {
|
|
|
102
102
|
}, e.id))
|
|
103
103
|
})
|
|
104
104
|
]
|
|
105
|
-
}) : /* @__PURE__ */
|
|
105
|
+
}) : /* @__PURE__ */ f("div", {
|
|
106
106
|
className: "flex items-center justify-center min-h-[400px]",
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ p("div", {
|
|
108
108
|
className: "text-center space-y-2",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
110
110
|
className: "text-lg font-semibold",
|
|
111
111
|
children: i(g, "activityList.accessDenied", "Access Denied")
|
|
112
|
-
}), /* @__PURE__ */
|
|
112
|
+
}), /* @__PURE__ */ f("p", {
|
|
113
113
|
className: "text-sm text-text-secondary",
|
|
114
114
|
children: i(g, "activityList.accessDeniedDescription", "You don't have permission to view activity.")
|
|
115
115
|
})]
|
|
@@ -1,257 +1,289 @@
|
|
|
1
1
|
import { useCreateWorkspace as e } from "../hooks/useWorkspaceMutations.js";
|
|
2
2
|
import { useOpenWorkspace as t } from "../hooks/useOpenWorkspace.js";
|
|
3
3
|
import { useMyOrganizations as ee, useMyTenants as te } from "../hooks/useTenants.js";
|
|
4
|
-
import { useOrgsWithPermission as
|
|
5
|
-
import { useWorkspacesContext as
|
|
6
|
-
import { useWorkspacesPageView as
|
|
7
|
-
import { generateSlug as
|
|
8
|
-
import { tWithFallback as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { Button as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
4
|
+
import { useOrgsWithPermission as ne } from "../hooks/useOrgsWithPermission.js";
|
|
5
|
+
import { useIsFluidGridsVariant as re, useWorkspacesContext as ie } from "../providers/WorkspacesProvider.js";
|
|
6
|
+
import { useWorkspacesPageView as ae } from "../hooks/useWorkspacesPageView.js";
|
|
7
|
+
import { generateSlug as oe } from "../utils/slug.js";
|
|
8
|
+
import { tWithFallback as n } from "../utils/i18n.js";
|
|
9
|
+
import { buildCreateWorkspaceInput as se } from "../utils/createForms.js";
|
|
10
|
+
import { useEffect as r, useMemo as i } from "react";
|
|
11
|
+
import { AlertCircle as a, ArrowLeft as o } from "lucide-react";
|
|
12
|
+
import { Button as s, CardContent as c, CardDescription as l, CardHeader as u, CardTitle as d, GlassCard as f, OptionalFields as p, PagePurpose as ce, Skeleton as m } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { Fragment as le, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { useI18n as ue } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { Link as _, useNavigate as de, useSearchParams as fe } from "react-router";
|
|
16
|
+
import { useUpgradePrompt as pe } from "@burdenoff/fe-libs/shared/hooks";
|
|
17
|
+
import { AccessDenied as v, UpgradeInlineBanner as me } from "@burdenoff/fe-libs/shared/components";
|
|
18
|
+
import { useForm as y, z as b } from "@burdenoff/fe-libs/form";
|
|
18
19
|
// src/pages/CreateWorkspacePage.tsx
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
let { t:
|
|
22
|
-
name:
|
|
23
|
-
slug:
|
|
24
|
-
tenantId:
|
|
25
|
-
organizationId:
|
|
26
|
-
}), [
|
|
27
|
-
schema:
|
|
20
|
+
function x() {
|
|
21
|
+
ae("workspaces.create");
|
|
22
|
+
let { t: x } = ue(), { isFree: he, approachingLimits: ge, plan: _e } = pe({ resource: "workspaces" }), S = ge[0], C = !!S && typeof S.limit == "number" && S.current >= S.limit, ve = he && !!S, w = i(() => b.object({
|
|
23
|
+
name: b.string().min(2, n(x, "createWorkspace.validation.nameMin", "Name must be at least 2 characters")).max(100),
|
|
24
|
+
slug: b.string().min(2, n(x, "createWorkspace.validation.slugMin", "Slug must be at least 2 characters")).max(50).regex(/^[a-z0-9-]+$/, n(x, "createWorkspace.validation.slugFormat", "Slug can only contain lowercase letters, numbers, and hyphens")),
|
|
25
|
+
tenantId: b.string().min(1, n(x, "createWorkspace.validation.tenantRequired", "Please select a tenant")),
|
|
26
|
+
organizationId: b.string().min(1, n(x, "createWorkspace.validation.organizationRequired", "Please select an organization"))
|
|
27
|
+
}), [x]), T = de(), { basePath: E = "/" } = ie(), D = re(), [O] = fe(), k = D ? O.get("organizationId") : null, { mutate: A, isPending: j } = e(), M = t(), { data: N, isLoading: P, error: F } = te(), { data: I, isLoading: L, error: R } = ee(), z = i(() => N?.items ?? [], [N]), B = i(() => I?.items ?? [], [I]), V = i(() => k ? B.find((e) => e.id === k) : void 0, [B, k]), H = i(() => z.find((e) => e.type === "SHARED" || e.slug === "burdenoff-shared")?.id ?? z[0]?.id ?? "", [z]), U = y({
|
|
28
|
+
schema: w,
|
|
28
29
|
defaultValues: {
|
|
29
30
|
name: "",
|
|
30
31
|
slug: "",
|
|
31
32
|
tenantId: "",
|
|
32
33
|
organizationId: ""
|
|
33
34
|
}
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
}), W = U.watch("tenantId"), G = U.watch("name"), ye = i(() => B.map((e) => e.id), [B]), { allowedIds: K, loading: q, isError: J } = ne(ye, "workspace", "create"), Y = i(() => W ? B.filter((e) => e.tenantId === W) : [], [W, B]), X = i(() => J ? Y : Y.filter((e) => K.has(e.id)), [
|
|
36
|
+
Y,
|
|
37
|
+
K,
|
|
38
|
+
J
|
|
38
39
|
]);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
!
|
|
40
|
+
r(() => {
|
|
41
|
+
U.setValue("slug", G ? oe(G) : "");
|
|
42
|
+
}, [G, U]), r(() => {
|
|
43
|
+
U.setValue("organizationId", "");
|
|
44
|
+
}, [W, U]), r(() => {
|
|
45
|
+
!U.getValues("tenantId") && H && U.setValue("tenantId", H, {
|
|
45
46
|
shouldDirty: !1,
|
|
46
47
|
shouldTouch: !1
|
|
47
48
|
});
|
|
48
|
-
}, [
|
|
49
|
-
let e =
|
|
50
|
-
!
|
|
49
|
+
}, [H, U]), r(() => {
|
|
50
|
+
let e = V?.tenantId;
|
|
51
|
+
e && !U.getFieldState("tenantId").isDirty && U.getValues("tenantId") !== e && z.some((t) => t.id === e) && U.setValue("tenantId", e, {
|
|
51
52
|
shouldDirty: !1,
|
|
52
53
|
shouldTouch: !1
|
|
53
54
|
});
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
}, [
|
|
56
|
+
V,
|
|
57
|
+
z,
|
|
58
|
+
U
|
|
59
|
+
]), r(() => {
|
|
60
|
+
let e = U.getValues("organizationId");
|
|
61
|
+
if (!X.some((t) => t.id === e) && X[0]?.id) {
|
|
62
|
+
let e = X.find((e) => e.id === k);
|
|
63
|
+
U.setValue("organizationId", (e ?? X[0]).id, {
|
|
64
|
+
shouldDirty: !1,
|
|
65
|
+
shouldTouch: !1
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [
|
|
69
|
+
X,
|
|
70
|
+
U,
|
|
71
|
+
k
|
|
72
|
+
]);
|
|
73
|
+
let be = (e) => {
|
|
74
|
+
A(se(e), { onSuccess: (e) => {
|
|
75
|
+
M(e);
|
|
63
76
|
} });
|
|
64
|
-
},
|
|
65
|
-
|
|
77
|
+
}, Z = K.size > 0, xe = P || L || q, Se = !F && !R && B.length > 0;
|
|
78
|
+
if (!xe && !J && Se && !Z) return /* @__PURE__ */ g("div", {
|
|
66
79
|
className: "p-6",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
68
|
-
to: `${
|
|
80
|
+
children: [/* @__PURE__ */ g(_, {
|
|
81
|
+
to: `${E}/list`,
|
|
69
82
|
className: "inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors mb-6",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
}), /* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ h(o, { size: 20 }), n(x, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
|
|
84
|
+
}), /* @__PURE__ */ h(v, {
|
|
72
85
|
variant: "card",
|
|
73
|
-
title:
|
|
74
|
-
description:
|
|
75
|
-
details:
|
|
86
|
+
title: n(x, "createWorkspace.permissionRequiredTitle", "Permission Required"),
|
|
87
|
+
description: n(x, "createWorkspace.permissionRequiredDescription", "You don't have permission to create workspaces in any of your organizations."),
|
|
88
|
+
details: n(x, "createWorkspace.permissionRequiredDetails", "Required: workspace:create"),
|
|
76
89
|
primaryAction: {
|
|
77
|
-
label:
|
|
78
|
-
onClick: () =>
|
|
90
|
+
label: n(x, "createWorkspace.goBack", "Go Back"),
|
|
91
|
+
onClick: () => T(`${E}/list`)
|
|
79
92
|
}
|
|
80
93
|
})]
|
|
81
|
-
})
|
|
94
|
+
});
|
|
95
|
+
let Q = /* @__PURE__ */ g("div", {
|
|
96
|
+
className: "space-y-2",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ h("label", {
|
|
99
|
+
htmlFor: "workspace-slug",
|
|
100
|
+
className: "text-sm font-medium text-text-primary",
|
|
101
|
+
children: n(x, "createWorkspace.slugLabel", "Slug *")
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ h("input", {
|
|
104
|
+
id: "workspace-slug",
|
|
105
|
+
placeholder: n(x, "createWorkspace.slugPlaceholder", "my-workspace"),
|
|
106
|
+
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
107
|
+
...U.register("slug")
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ h("p", {
|
|
110
|
+
className: "text-xs text-text-secondary",
|
|
111
|
+
children: n(x, "createWorkspace.slugHint", "URL-friendly identifier (auto-generated, but you can edit it)")
|
|
112
|
+
}),
|
|
113
|
+
U.formState.errors.slug?.message && /* @__PURE__ */ h("p", {
|
|
114
|
+
className: "text-sm text-status-error-text",
|
|
115
|
+
children: U.formState.errors.slug.message
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}), $ = z.length === 1 ? null : /* @__PURE__ */ g("div", {
|
|
119
|
+
className: "space-y-2",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ h("label", {
|
|
122
|
+
htmlFor: "workspace-tenant",
|
|
123
|
+
className: "text-sm font-medium text-text-primary",
|
|
124
|
+
children: n(x, "createWorkspace.tenantLabel", "Tenant *")
|
|
125
|
+
}),
|
|
126
|
+
P ? /* @__PURE__ */ h(m, { className: "h-10 w-full" }) : F ? /* @__PURE__ */ g("div", {
|
|
127
|
+
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
128
|
+
children: [/* @__PURE__ */ h(a, { size: 16 }), n(x, "createWorkspace.failedToLoadTenants", "Failed to load tenants")]
|
|
129
|
+
}) : z.length === 0 ? /* @__PURE__ */ h("div", {
|
|
130
|
+
className: "text-sm text-text-secondary",
|
|
131
|
+
children: n(x, "createWorkspace.noTenantsAvailable", "No tenants available. Contact your administrator.")
|
|
132
|
+
}) : /* @__PURE__ */ g("select", {
|
|
133
|
+
id: "workspace-tenant",
|
|
134
|
+
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
135
|
+
...U.register("tenantId"),
|
|
136
|
+
children: [/* @__PURE__ */ h("option", {
|
|
137
|
+
value: "",
|
|
138
|
+
children: n(x, "createWorkspace.selectTenantPlaceholder", "Select a tenant")
|
|
139
|
+
}), z.map((e) => /* @__PURE__ */ h("option", {
|
|
140
|
+
value: e.id,
|
|
141
|
+
children: e.name
|
|
142
|
+
}, e.id))]
|
|
143
|
+
}),
|
|
144
|
+
/* @__PURE__ */ h("p", {
|
|
145
|
+
className: "text-xs text-text-secondary",
|
|
146
|
+
children: n(x, "createWorkspace.tenantHint", "Select which tenant this workspace belongs to")
|
|
147
|
+
}),
|
|
148
|
+
U.formState.errors.tenantId?.message && /* @__PURE__ */ h("p", {
|
|
149
|
+
className: "text-sm text-status-error-text",
|
|
150
|
+
children: U.formState.errors.tenantId.message
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
}), Ce = ["slug", "tenantId"].flatMap((e) => {
|
|
154
|
+
let t = U.formState.errors[e]?.message;
|
|
155
|
+
return t ? [{
|
|
156
|
+
field: e,
|
|
157
|
+
message: t
|
|
158
|
+
}] : [];
|
|
159
|
+
});
|
|
160
|
+
return /* @__PURE__ */ g("div", {
|
|
82
161
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6",
|
|
83
162
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
to: `${
|
|
163
|
+
/* @__PURE__ */ g(_, {
|
|
164
|
+
to: `${E}/list`,
|
|
86
165
|
className: "inline-flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ h(o, { size: 20 }), n(x, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
|
|
88
167
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ h("div", {
|
|
90
169
|
className: "max-w-2xl mx-auto w-full",
|
|
91
|
-
children: /* @__PURE__ */
|
|
170
|
+
children: /* @__PURE__ */ h(ce, { children: n(x, "createWorkspace.purpose", "Create a workspace to give a team, client or initiative its own dedicated space — with its own projects, members, agents and activity, kept separate from the rest. Give it a clear name, pick the organization that owns it, and you can invite people and add projects right after.") })
|
|
92
171
|
}),
|
|
93
|
-
|
|
172
|
+
ve && /* @__PURE__ */ h("div", {
|
|
94
173
|
className: "max-w-2xl mx-auto w-full",
|
|
95
|
-
children: /* @__PURE__ */
|
|
174
|
+
children: /* @__PURE__ */ h(me, {
|
|
96
175
|
resource: "workspaces",
|
|
97
|
-
current:
|
|
98
|
-
limit:
|
|
99
|
-
severity:
|
|
100
|
-
message:
|
|
176
|
+
current: S.current,
|
|
177
|
+
limit: S.limit ?? void 0,
|
|
178
|
+
severity: C ? "critical" : void 0,
|
|
179
|
+
message: C ? n(x, "createWorkspace.upgradeCapMessage", `You've used all workspaces in the ${_e?.planName ?? "free"} plan.`) : n(x, "createWorkspace.upgradeApproachingMessage", "Upgrade to create more workspaces.")
|
|
101
180
|
})
|
|
102
181
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ g(f, {
|
|
104
183
|
treatment: "glass",
|
|
105
184
|
glow: !0,
|
|
106
185
|
className: "max-w-2xl mx-auto border-border-seam",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ g(u, { children: [D ? /* @__PURE__ */ h("h1", {
|
|
187
|
+
className: "text-lg font-semibold leading-none text-text-primary",
|
|
188
|
+
children: n(x, "createWorkspace.title", "Create New Workspace")
|
|
189
|
+
}) : /* @__PURE__ */ h(d, { children: n(x, "createWorkspace.title", "Create New Workspace") }), /* @__PURE__ */ h(l, { children: n(x, "createWorkspace.subtitle", "Set up a new workspace for your team") })] }), /* @__PURE__ */ g(c, { children: [J && /* @__PURE__ */ g("div", {
|
|
108
190
|
role: "alert",
|
|
109
191
|
className: "mb-4 flex items-start gap-2 rounded-md border border-warning/30 bg-warning/10 p-3 text-sm text-text-primary",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ h(a, {
|
|
111
193
|
size: 16,
|
|
112
194
|
className: "mt-0.5 shrink-0 text-warning"
|
|
113
|
-
}), /* @__PURE__ */
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
-
onSubmit:
|
|
195
|
+
}), /* @__PURE__ */ h("span", { children: n(x, "createWorkspace.permissionCheckUnavailable", "We couldn't verify your workspace-create permissions just now, so the organization list isn't filtered. If you submit and don't have access, the request will be rejected and you can retry.") })]
|
|
196
|
+
}), /* @__PURE__ */ g("form", {
|
|
197
|
+
onSubmit: U.handleSubmit(be),
|
|
116
198
|
className: "space-y-6",
|
|
117
199
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ g("div", {
|
|
119
201
|
className: "space-y-2",
|
|
120
202
|
children: [
|
|
121
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ h("label", {
|
|
122
204
|
htmlFor: "workspace-name",
|
|
123
205
|
className: "text-sm font-medium text-text-primary",
|
|
124
|
-
children:
|
|
206
|
+
children: n(x, "createWorkspace.nameLabel", "Workspace Name *")
|
|
125
207
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ h("input", {
|
|
127
209
|
id: "workspace-name",
|
|
128
|
-
placeholder:
|
|
129
|
-
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
130
|
-
...G.register("name")
|
|
131
|
-
}),
|
|
132
|
-
/* @__PURE__ */ l("p", {
|
|
133
|
-
className: "text-xs text-text-secondary",
|
|
134
|
-
children: i(E, "createWorkspace.nameHint", "A descriptive name for your workspace")
|
|
135
|
-
}),
|
|
136
|
-
G.formState.errors.name?.message && /* @__PURE__ */ l("p", {
|
|
137
|
-
className: "text-sm text-status-error-text",
|
|
138
|
-
children: G.formState.errors.name.message
|
|
139
|
-
})
|
|
140
|
-
]
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ u("div", {
|
|
143
|
-
className: "space-y-2",
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ l("label", {
|
|
146
|
-
htmlFor: "workspace-slug",
|
|
147
|
-
className: "text-sm font-medium text-text-primary",
|
|
148
|
-
children: i(E, "createWorkspace.slugLabel", "Slug *")
|
|
149
|
-
}),
|
|
150
|
-
/* @__PURE__ */ l("input", {
|
|
151
|
-
id: "workspace-slug",
|
|
152
|
-
placeholder: i(E, "createWorkspace.slugPlaceholder", "my-workspace"),
|
|
210
|
+
placeholder: n(x, "createWorkspace.namePlaceholder", "My Workspace"),
|
|
153
211
|
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary",
|
|
154
|
-
...
|
|
155
|
-
}),
|
|
156
|
-
/* @__PURE__ */ l("p", {
|
|
157
|
-
className: "text-xs text-text-secondary",
|
|
158
|
-
children: i(E, "createWorkspace.slugHint", "URL-friendly identifier (auto-generated, but you can edit it)")
|
|
159
|
-
}),
|
|
160
|
-
G.formState.errors.slug?.message && /* @__PURE__ */ l("p", {
|
|
161
|
-
className: "text-sm text-status-error-text",
|
|
162
|
-
children: G.formState.errors.slug.message
|
|
163
|
-
})
|
|
164
|
-
]
|
|
165
|
-
}),
|
|
166
|
-
H.length === 1 ? null : /* @__PURE__ */ u("div", {
|
|
167
|
-
className: "space-y-2",
|
|
168
|
-
children: [
|
|
169
|
-
/* @__PURE__ */ l("label", {
|
|
170
|
-
htmlFor: "workspace-tenant",
|
|
171
|
-
className: "text-sm font-medium text-text-primary",
|
|
172
|
-
children: i(E, "createWorkspace.tenantLabel", "Tenant *")
|
|
173
|
-
}),
|
|
174
|
-
L ? /* @__PURE__ */ l(v, { className: "h-10 w-full" }) : R ? /* @__PURE__ */ u("div", {
|
|
175
|
-
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
176
|
-
children: [/* @__PURE__ */ l(s, { size: 16 }), i(E, "createWorkspace.failedToLoadTenants", "Failed to load tenants")]
|
|
177
|
-
}) : H.length === 0 ? /* @__PURE__ */ l("div", {
|
|
178
|
-
className: "text-sm text-text-secondary",
|
|
179
|
-
children: i(E, "createWorkspace.noTenantsAvailable", "No tenants available. Contact your administrator.")
|
|
180
|
-
}) : /* @__PURE__ */ u("select", {
|
|
181
|
-
id: "workspace-tenant",
|
|
182
|
-
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
183
|
-
...G.register("tenantId"),
|
|
184
|
-
children: [/* @__PURE__ */ l("option", {
|
|
185
|
-
value: "",
|
|
186
|
-
children: i(E, "createWorkspace.selectTenantPlaceholder", "Select a tenant")
|
|
187
|
-
}), H.map((e) => /* @__PURE__ */ l("option", {
|
|
188
|
-
value: e.id,
|
|
189
|
-
children: e.name
|
|
190
|
-
}, e.id))]
|
|
212
|
+
...U.register("name")
|
|
191
213
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ h("p", {
|
|
193
215
|
className: "text-xs text-text-secondary",
|
|
194
|
-
children:
|
|
216
|
+
children: n(x, "createWorkspace.nameHint", "A descriptive name for your workspace")
|
|
195
217
|
}),
|
|
196
|
-
|
|
218
|
+
U.formState.errors.name?.message && /* @__PURE__ */ h("p", {
|
|
197
219
|
className: "text-sm text-status-error-text",
|
|
198
|
-
children:
|
|
220
|
+
children: U.formState.errors.name.message
|
|
199
221
|
})
|
|
200
222
|
]
|
|
201
223
|
}),
|
|
202
|
-
|
|
224
|
+
D ? null : Q,
|
|
225
|
+
D ? null : $,
|
|
226
|
+
/* @__PURE__ */ g("div", {
|
|
203
227
|
className: "space-y-2",
|
|
204
228
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ h("label", {
|
|
206
230
|
htmlFor: "workspace-organization",
|
|
207
231
|
className: "text-sm font-medium text-text-primary",
|
|
208
|
-
children:
|
|
232
|
+
children: n(x, "createWorkspace.organizationLabel", "Organization *")
|
|
209
233
|
}),
|
|
210
|
-
|
|
234
|
+
L || q ? /* @__PURE__ */ h(m, { className: "h-10 w-full" }) : R ? /* @__PURE__ */ g("div", {
|
|
211
235
|
className: "flex items-center gap-2 text-sm text-status-error-text",
|
|
212
|
-
children: [/* @__PURE__ */
|
|
213
|
-
}) :
|
|
236
|
+
children: [/* @__PURE__ */ h(a, { size: 16 }), n(x, "createWorkspace.failedToLoadOrganizations", "Failed to load organizations")]
|
|
237
|
+
}) : W ? X.length === 0 ? /* @__PURE__ */ h("div", {
|
|
214
238
|
className: "text-sm text-text-secondary",
|
|
215
|
-
children:
|
|
216
|
-
}) : /* @__PURE__ */
|
|
239
|
+
children: n(x, "createWorkspace.noOrganizationsFound", "No organizations found for this tenant")
|
|
240
|
+
}) : /* @__PURE__ */ g("select", {
|
|
217
241
|
id: "workspace-organization",
|
|
218
242
|
className: "h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
219
|
-
disabled: !
|
|
220
|
-
...
|
|
221
|
-
children: [/* @__PURE__ */
|
|
243
|
+
disabled: !W,
|
|
244
|
+
...U.register("organizationId"),
|
|
245
|
+
children: [/* @__PURE__ */ h("option", {
|
|
222
246
|
value: "",
|
|
223
|
-
children:
|
|
224
|
-
}),
|
|
247
|
+
children: n(x, "createWorkspace.selectOrganizationPlaceholder", "Select an organization")
|
|
248
|
+
}), X.map((e) => /* @__PURE__ */ h("option", {
|
|
225
249
|
value: e.id,
|
|
226
250
|
children: e.name
|
|
227
251
|
}, e.id))]
|
|
228
|
-
}) : /* @__PURE__ */
|
|
252
|
+
}) : /* @__PURE__ */ h("div", {
|
|
229
253
|
className: "text-sm text-text-secondary",
|
|
230
|
-
children:
|
|
254
|
+
children: n(x, "createWorkspace.selectTenantFirst", "Please select a tenant first")
|
|
231
255
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ h("p", {
|
|
233
257
|
className: "text-xs text-text-secondary",
|
|
234
|
-
children:
|
|
258
|
+
children: n(x, "createWorkspace.organizationHint", "Select which organization owns this workspace")
|
|
235
259
|
}),
|
|
236
|
-
|
|
260
|
+
U.formState.errors.organizationId?.message && /* @__PURE__ */ h("p", {
|
|
237
261
|
className: "text-sm text-status-error-text",
|
|
238
|
-
children:
|
|
262
|
+
children: U.formState.errors.organizationId.message
|
|
239
263
|
})
|
|
240
264
|
]
|
|
241
265
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
266
|
+
D ? /* @__PURE__ */ g(le, { children: [Ce.map(({ field: e, message: t }) => /* @__PURE__ */ h("p", {
|
|
267
|
+
role: "alert",
|
|
268
|
+
className: "text-sm text-status-error-text",
|
|
269
|
+
children: t
|
|
270
|
+
}, e)), /* @__PURE__ */ g(p, {
|
|
271
|
+
storageKey: "workspaces.create",
|
|
272
|
+
children: [Q, $]
|
|
273
|
+
})] }) : null,
|
|
274
|
+
/* @__PURE__ */ g("div", {
|
|
243
275
|
className: "flex justify-end gap-3 pt-4",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ h(s, {
|
|
245
277
|
type: "button",
|
|
246
278
|
variant: "outline",
|
|
247
|
-
onClick: () =>
|
|
248
|
-
disabled:
|
|
249
|
-
children:
|
|
250
|
-
}), /* @__PURE__ */
|
|
279
|
+
onClick: () => T(`${E}/list`),
|
|
280
|
+
disabled: j,
|
|
281
|
+
children: n(x, "createWorkspace.cancel", "Cancel")
|
|
282
|
+
}), /* @__PURE__ */ h(s, {
|
|
251
283
|
type: "submit",
|
|
252
|
-
disabled:
|
|
253
|
-
title:
|
|
254
|
-
children:
|
|
284
|
+
disabled: j || P || L || q || C,
|
|
285
|
+
title: C ? n(x, "createWorkspace.disabledAtCap", "Workspace limit reached — upgrade your plan to create more.") : void 0,
|
|
286
|
+
children: j ? n(x, "createWorkspace.creating", "Creating...") : n(x, "createWorkspace.submit", "Create Workspace")
|
|
255
287
|
})]
|
|
256
288
|
})
|
|
257
289
|
]
|
|
@@ -260,4 +292,4 @@ function E() {
|
|
|
260
292
|
]
|
|
261
293
|
});
|
|
262
294
|
}
|
|
263
|
-
export {
|
|
295
|
+
export { x as CreateWorkspacePage };
|