@burdenoff/microfe-workspaces 2026.1113.1 → 2026.1114.2

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.
Files changed (60) hide show
  1. package/dist/WorkspacesRoot.js +31 -25
  2. package/dist/WorkspacesRoutes.js +56 -55
  3. package/dist/components/CreateProjectDialog.js +81 -78
  4. package/dist/components/CreateWorkspaceDialog.js +41 -41
  5. package/dist/components/InviteMemberDialog.js +54 -54
  6. package/dist/components/MemberListItem.js +53 -53
  7. package/dist/components/PendingInvitesRoute.d.ts +7 -0
  8. package/dist/components/PendingInvitesRoute.js +15 -0
  9. package/dist/components/ProjectCard.js +82 -82
  10. package/dist/components/ProjectMemberPickerDialog.js +46 -46
  11. package/dist/components/RenameProjectDialog.js +16 -16
  12. package/dist/components/WorkspaceCard.js +18 -18
  13. package/dist/components/WorkspacesErrorBoundary.js +25 -25
  14. package/dist/components/tags/ProjectTagsWidget.js +50 -50
  15. package/dist/components/tags/WorkspaceTagsEditor.js +9 -9
  16. package/dist/constants/navigationV2.d.ts +12 -0
  17. package/dist/constants/navigationV2.js +3 -0
  18. package/dist/hooks/useNavigationV2.d.ts +6 -0
  19. package/dist/hooks/useNavigationV2.js +6 -0
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +15 -14
  22. package/dist/pages/ActivityListPage.js +30 -30
  23. package/dist/pages/CreateWorkspacePage.js +205 -173
  24. package/dist/pages/InviteAcceptancePage.js +210 -200
  25. package/dist/pages/MembersListPage.js +165 -164
  26. package/dist/pages/PendingInvitesPage.js +67 -67
  27. package/dist/pages/ProjectDetailPage.js +297 -272
  28. package/dist/pages/ProjectMembersPage.js +59 -59
  29. package/dist/pages/ProjectsListPage.js +275 -244
  30. package/dist/pages/WorkspaceDetailPage.js +175 -172
  31. package/dist/pages/WorkspaceInvitePage.js +606 -503
  32. package/dist/pages/WorkspaceSettingsPage.js +48 -48
  33. package/dist/pages/WorkspacesListPage.js +55 -55
  34. package/dist/pages/dashboard/DashboardCustomizer.js +27 -27
  35. package/dist/pages/dashboard/DashboardPage.js +35 -35
  36. package/dist/pages/dashboard/WidgetWrapper.js +21 -21
  37. package/dist/pages/dashboard/widgets/AgentsWidget.js +25 -25
  38. package/dist/pages/dashboard/widgets/GroupsWidget.js +14 -14
  39. package/dist/pages/dashboard/widgets/MembersWidget.js +15 -15
  40. package/dist/pages/dashboard/widgets/ProjectsWidget.js +20 -20
  41. package/dist/pages/dashboard/widgets/QuickActionsWidget.js +7 -7
  42. package/dist/pages/dashboard/widgets/RecentActivityWidget.js +16 -16
  43. package/dist/pages/dashboard/widgets/SessionsWidget.js +15 -15
  44. package/dist/pages/dashboard/widgets/TagCloudWidget.js +11 -11
  45. package/dist/pages/dashboard/widgets/UpcomingEventsWidget.js +16 -16
  46. package/dist/pages/dashboard/widgets/VibesWidget.js +13 -13
  47. package/dist/pages/dashboard/widgets/WelcomeWidget.js +23 -23
  48. package/dist/pages/dashboard/widgets/WorkflowRunsWidget.js +26 -26
  49. package/dist/pages/dashboard/widgets/WorkflowStatsWidget.js +21 -21
  50. package/dist/pages/dashboard/widgets/WorkflowsOverviewWidget.js +22 -22
  51. package/dist/pages/dashboard/widgets/WorkspacesWidget.js +16 -16
  52. package/dist/providers/WorkspacesProvider.d.ts +5 -0
  53. package/dist/providers/WorkspacesProvider.js +2 -2
  54. package/dist/types/index.d.ts +11 -1
  55. package/dist/utils/createForms.d.ts +21 -0
  56. package/dist/utils/createForms.js +20 -0
  57. package/dist/utils/index.d.ts +1 -0
  58. package/dist/utils/invitationPayload.d.ts +18 -0
  59. package/dist/utils/invitationPayload.js +13 -0
  60. 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 { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { CardContent as s, CardHeader as c, CardTitle as l, GlassCard as u, IllustratedEmptyState as d, PagePurpose as f, Skeleton as p } from "@burdenoff/fe-libs/ui";
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__ */ o("div", {
18
+ return S ? /* @__PURE__ */ p("div", {
19
19
  className: "space-y-4 p-6",
20
- children: [/* @__PURE__ */ a(p, { className: "h-10 w-1/3" }), /* @__PURE__ */ a(p, { className: "h-64" })]
21
- }) : x ? /* @__PURE__ */ o("div", {
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__ */ o("div", { children: [/* @__PURE__ */ a("h1", {
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__ */ a("p", {
27
+ }), /* @__PURE__ */ f("p", {
28
28
  className: "text-text-secondary",
29
29
  children: i(g, "activityList.description", "Track workspace activity")
30
30
  })] }),
31
- /* @__PURE__ */ a(f, { 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__ */ a(u, {
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(s, {
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__ */ a(u, {
39
+ }) : b ? /* @__PURE__ */ f(c, {
40
40
  treatment: "plain",
41
41
  className: "border-border-seam",
42
- children: /* @__PURE__ */ a(s, {
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__ */ a(d, {
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__ */ a("div", {
50
+ }) : /* @__PURE__ */ f("div", {
51
51
  className: "space-y-3",
52
- children: v?.map((e) => /* @__PURE__ */ o(u, {
52
+ children: v?.map((e) => /* @__PURE__ */ p(c, {
53
53
  treatment: "insight",
54
54
  className: "border-border-seam",
55
- children: [/* @__PURE__ */ a(c, {
55
+ children: [/* @__PURE__ */ f(o, {
56
56
  className: "pb-2",
57
- children: /* @__PURE__ */ a(l, {
57
+ children: /* @__PURE__ */ f(s, {
58
58
  className: "text-base",
59
59
  children: e.description || e.action
60
60
  })
61
- }), /* @__PURE__ */ o(s, {
61
+ }), /* @__PURE__ */ p(a, {
62
62
  className: "space-y-1 text-sm text-text-muted",
63
63
  children: [
64
- /* @__PURE__ */ o("p", { children: [
64
+ /* @__PURE__ */ p("p", { children: [
65
65
  i(g, "activityList.labelAction", "Action"),
66
66
  ":",
67
67
  " ",
68
- /* @__PURE__ */ a("span", {
68
+ /* @__PURE__ */ f("span", {
69
69
  className: "text-text-primary",
70
70
  children: e.action
71
71
  })
72
72
  ] }),
73
- e.resourceType && /* @__PURE__ */ o("p", { children: [
73
+ e.resourceType && /* @__PURE__ */ p("p", { children: [
74
74
  i(g, "activityList.labelResource", "Resource"),
75
75
  ":",
76
76
  " ",
77
- /* @__PURE__ */ a("span", {
77
+ /* @__PURE__ */ f("span", {
78
78
  className: "text-text-primary",
79
79
  children: e.resourceType
80
80
  })
81
81
  ] }),
82
- /* @__PURE__ */ o("p", { children: [
82
+ /* @__PURE__ */ p("p", { children: [
83
83
  i(g, "activityList.labelWhen", "When"),
84
84
  ":",
85
85
  " ",
86
- /* @__PURE__ */ a("span", {
86
+ /* @__PURE__ */ f("span", {
87
87
  className: "text-text-primary",
88
88
  children: r(e.timestamp)
89
89
  })
90
90
  ] }),
91
- /* @__PURE__ */ o("p", { children: [
91
+ /* @__PURE__ */ p("p", { children: [
92
92
  i(g, "activityList.labelActor", "Actor"),
93
93
  ":",
94
94
  " ",
95
- /* @__PURE__ */ a("span", {
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__ */ a("div", {
105
+ }) : /* @__PURE__ */ f("div", {
106
106
  className: "flex items-center justify-center min-h-[400px]",
107
- children: /* @__PURE__ */ o("div", {
107
+ children: /* @__PURE__ */ p("div", {
108
108
  className: "text-center space-y-2",
109
- children: [/* @__PURE__ */ a("h2", {
109
+ children: [/* @__PURE__ */ f("h2", {
110
110
  className: "text-lg font-semibold",
111
111
  children: i(g, "activityList.accessDenied", "Access Denied")
112
- }), /* @__PURE__ */ a("p", {
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 n } from "../hooks/useOrgsWithPermission.js";
5
- import { useWorkspacesContext as r } from "../providers/WorkspacesProvider.js";
6
- import { useWorkspacesPageView as ne } from "../hooks/useWorkspacesPageView.js";
7
- import { generateSlug as re } from "../utils/slug.js";
8
- import { tWithFallback as i } from "../utils/i18n.js";
9
- import { useEffect as a, useMemo as o } from "react";
10
- import { AlertCircle as s, ArrowLeft as c } from "lucide-react";
11
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
12
- import { Button as d, CardContent as f, CardDescription as p, CardHeader as m, CardTitle as h, GlassCard as g, PagePurpose as _, Skeleton as v } from "@burdenoff/fe-libs/ui";
13
- import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
- import { Link as b, useNavigate as x } from "react-router";
15
- import { useUpgradePrompt as S } from "@burdenoff/fe-libs/shared/hooks";
16
- import { AccessDenied as C, UpgradeInlineBanner as w } from "@burdenoff/fe-libs/shared/components";
17
- import { useForm as ie, z as T } from "@burdenoff/fe-libs/form";
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 E() {
20
- ne("workspaces.create");
21
- let { t: E } = y(), { isFree: ae, approachingLimits: oe, plan: se } = S({ resource: "workspaces" }), D = oe[0], O = !!D && typeof D.limit == "number" && D.current >= D.limit, k = ae && !!D, A = o(() => T.object({
22
- name: T.string().min(2, i(E, "createWorkspace.validation.nameMin", "Name must be at least 2 characters")).max(100),
23
- slug: T.string().min(2, i(E, "createWorkspace.validation.slugMin", "Slug must be at least 2 characters")).max(50).regex(/^[a-z0-9-]+$/, i(E, "createWorkspace.validation.slugFormat", "Slug can only contain lowercase letters, numbers, and hyphens")),
24
- tenantId: T.string().min(1, i(E, "createWorkspace.validation.tenantRequired", "Please select a tenant")),
25
- organizationId: T.string().min(1, i(E, "createWorkspace.validation.organizationRequired", "Please select an organization"))
26
- }), [E]), j = x(), { basePath: M = "/" } = r(), { mutate: N, isPending: P } = e(), F = t(), { data: I, isLoading: L, error: R } = te(), { data: z, isLoading: B, error: V } = ee(), H = o(() => I?.items ?? [], [I]), U = o(() => z?.items ?? [], [z]), W = o(() => H.find((e) => e.type === "SHARED" || e.slug === "burdenoff-shared")?.id ?? H[0]?.id ?? "", [H]), G = ie({
27
- schema: A,
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
- }), K = G.watch("tenantId"), q = G.watch("name"), ce = o(() => U.map((e) => e.id), [U]), { allowedIds: J, loading: Y, isError: X } = n(ce, "workspace", "create"), Z = o(() => K ? U.filter((e) => e.tenantId === K) : [], [K, U]), Q = o(() => X ? Z : Z.filter((e) => J.has(e.id)), [
35
- Z,
36
- J,
37
- X
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
- a(() => {
40
- G.setValue("slug", q ? re(q) : "");
41
- }, [q, G]), a(() => {
42
- G.setValue("organizationId", "");
43
- }, [K, G]), a(() => {
44
- !G.getValues("tenantId") && W && G.setValue("tenantId", W, {
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
- }, [W, G]), a(() => {
49
- let e = G.getValues("organizationId");
50
- !Q.some((t) => t.id === e) && Q[0]?.id && G.setValue("organizationId", Q[0].id, {
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
- }, [Q, G]);
55
- let le = (e) => {
56
- N({
57
- name: e.name,
58
- slug: e.slug,
59
- tenantId: e.tenantId,
60
- organizationId: e.organizationId
61
- }, { onSuccess: (e) => {
62
- F(e);
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
- }, $ = J.size > 0, ue = L || B || Y, de = !R && !V && U.length > 0;
65
- return !ue && !X && de && !$ ? /* @__PURE__ */ u("div", {
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__ */ u(b, {
68
- to: `${M}/list`,
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__ */ l(c, { size: 20 }), i(E, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
71
- }), /* @__PURE__ */ l(C, {
83
+ children: [/* @__PURE__ */ h(o, { size: 20 }), n(x, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
84
+ }), /* @__PURE__ */ h(v, {
72
85
  variant: "card",
73
- title: i(E, "createWorkspace.permissionRequiredTitle", "Permission Required"),
74
- description: i(E, "createWorkspace.permissionRequiredDescription", "You don't have permission to create workspaces in any of your organizations."),
75
- details: i(E, "createWorkspace.permissionRequiredDetails", "Required: workspace:create"),
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: i(E, "createWorkspace.goBack", "Go Back"),
78
- onClick: () => j(`${M}/list`)
90
+ label: n(x, "createWorkspace.goBack", "Go Back"),
91
+ onClick: () => T(`${E}/list`)
79
92
  }
80
93
  })]
81
- }) : /* @__PURE__ */ u("div", {
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__ */ u(b, {
85
- to: `${M}/list`,
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__ */ l(c, { size: 20 }), i(E, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
166
+ children: [/* @__PURE__ */ h(o, { size: 20 }), n(x, "createWorkspace.backToWorkspaces", "Back to Workspaces")]
88
167
  }),
89
- /* @__PURE__ */ l("div", {
168
+ /* @__PURE__ */ h("div", {
90
169
  className: "max-w-2xl mx-auto w-full",
91
- children: /* @__PURE__ */ l(_, { children: i(E, "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.") })
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
- k && /* @__PURE__ */ l("div", {
172
+ ve && /* @__PURE__ */ h("div", {
94
173
  className: "max-w-2xl mx-auto w-full",
95
- children: /* @__PURE__ */ l(w, {
174
+ children: /* @__PURE__ */ h(me, {
96
175
  resource: "workspaces",
97
- current: D.current,
98
- limit: D.limit ?? void 0,
99
- severity: O ? "critical" : void 0,
100
- message: O ? i(E, "createWorkspace.upgradeCapMessage", `You've used all workspaces in the ${se?.planName ?? "free"} plan.`) : i(E, "createWorkspace.upgradeApproachingMessage", "Upgrade to create more workspaces.")
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__ */ u(g, {
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__ */ u(m, { children: [/* @__PURE__ */ l(h, { children: i(E, "createWorkspace.title", "Create New Workspace") }), /* @__PURE__ */ l(p, { children: i(E, "createWorkspace.subtitle", "Set up a new workspace for your team") })] }), /* @__PURE__ */ u(f, { children: [X && /* @__PURE__ */ u("div", {
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__ */ l(s, {
192
+ children: [/* @__PURE__ */ h(a, {
111
193
  size: 16,
112
194
  className: "mt-0.5 shrink-0 text-warning"
113
- }), /* @__PURE__ */ l("span", { children: i(E, "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.") })]
114
- }), /* @__PURE__ */ u("form", {
115
- onSubmit: G.handleSubmit(le),
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__ */ u("div", {
200
+ /* @__PURE__ */ g("div", {
119
201
  className: "space-y-2",
120
202
  children: [
121
- /* @__PURE__ */ l("label", {
203
+ /* @__PURE__ */ h("label", {
122
204
  htmlFor: "workspace-name",
123
205
  className: "text-sm font-medium text-text-primary",
124
- children: i(E, "createWorkspace.nameLabel", "Workspace Name *")
206
+ children: n(x, "createWorkspace.nameLabel", "Workspace Name *")
125
207
  }),
126
- /* @__PURE__ */ l("input", {
208
+ /* @__PURE__ */ h("input", {
127
209
  id: "workspace-name",
128
- placeholder: i(E, "createWorkspace.namePlaceholder", "My Workspace"),
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
- ...G.register("slug")
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__ */ l("p", {
214
+ /* @__PURE__ */ h("p", {
193
215
  className: "text-xs text-text-secondary",
194
- children: i(E, "createWorkspace.tenantHint", "Select which tenant this workspace belongs to")
216
+ children: n(x, "createWorkspace.nameHint", "A descriptive name for your workspace")
195
217
  }),
196
- G.formState.errors.tenantId?.message && /* @__PURE__ */ l("p", {
218
+ U.formState.errors.name?.message && /* @__PURE__ */ h("p", {
197
219
  className: "text-sm text-status-error-text",
198
- children: G.formState.errors.tenantId.message
220
+ children: U.formState.errors.name.message
199
221
  })
200
222
  ]
201
223
  }),
202
- /* @__PURE__ */ u("div", {
224
+ D ? null : Q,
225
+ D ? null : $,
226
+ /* @__PURE__ */ g("div", {
203
227
  className: "space-y-2",
204
228
  children: [
205
- /* @__PURE__ */ l("label", {
229
+ /* @__PURE__ */ h("label", {
206
230
  htmlFor: "workspace-organization",
207
231
  className: "text-sm font-medium text-text-primary",
208
- children: i(E, "createWorkspace.organizationLabel", "Organization *")
232
+ children: n(x, "createWorkspace.organizationLabel", "Organization *")
209
233
  }),
210
- B || Y ? /* @__PURE__ */ l(v, { className: "h-10 w-full" }) : V ? /* @__PURE__ */ u("div", {
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__ */ l(s, { size: 16 }), i(E, "createWorkspace.failedToLoadOrganizations", "Failed to load organizations")]
213
- }) : K ? Q.length === 0 ? /* @__PURE__ */ l("div", {
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: i(E, "createWorkspace.noOrganizationsFound", "No organizations found for this tenant")
216
- }) : /* @__PURE__ */ u("select", {
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: !K,
220
- ...G.register("organizationId"),
221
- children: [/* @__PURE__ */ l("option", {
243
+ disabled: !W,
244
+ ...U.register("organizationId"),
245
+ children: [/* @__PURE__ */ h("option", {
222
246
  value: "",
223
- children: i(E, "createWorkspace.selectOrganizationPlaceholder", "Select an organization")
224
- }), Q.map((e) => /* @__PURE__ */ l("option", {
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__ */ l("div", {
252
+ }) : /* @__PURE__ */ h("div", {
229
253
  className: "text-sm text-text-secondary",
230
- children: i(E, "createWorkspace.selectTenantFirst", "Please select a tenant first")
254
+ children: n(x, "createWorkspace.selectTenantFirst", "Please select a tenant first")
231
255
  }),
232
- /* @__PURE__ */ l("p", {
256
+ /* @__PURE__ */ h("p", {
233
257
  className: "text-xs text-text-secondary",
234
- children: i(E, "createWorkspace.organizationHint", "Select which organization owns this workspace")
258
+ children: n(x, "createWorkspace.organizationHint", "Select which organization owns this workspace")
235
259
  }),
236
- G.formState.errors.organizationId?.message && /* @__PURE__ */ l("p", {
260
+ U.formState.errors.organizationId?.message && /* @__PURE__ */ h("p", {
237
261
  className: "text-sm text-status-error-text",
238
- children: G.formState.errors.organizationId.message
262
+ children: U.formState.errors.organizationId.message
239
263
  })
240
264
  ]
241
265
  }),
242
- /* @__PURE__ */ u("div", {
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__ */ l(d, {
276
+ children: [/* @__PURE__ */ h(s, {
245
277
  type: "button",
246
278
  variant: "outline",
247
- onClick: () => j(`${M}/list`),
248
- disabled: P,
249
- children: i(E, "createWorkspace.cancel", "Cancel")
250
- }), /* @__PURE__ */ l(d, {
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: P || L || B || Y || O,
253
- title: O ? i(E, "createWorkspace.disabledAtCap", "Workspace limit reached — upgrade your plan to create more.") : void 0,
254
- children: P ? i(E, "createWorkspace.creating", "Creating...") : i(E, "createWorkspace.submit", "Create Workspace")
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 { E as CreateWorkspacePage };
295
+ export { x as CreateWorkspacePage };