@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
@@ -4,70 +4,76 @@ import { WorkspacesRoutes as n } from "./WorkspacesRoutes.js";
4
4
  import { useEffect as r, useMemo as i } from "react";
5
5
  import { Activity as a, Building2 as o, FolderKanban as s, Users as c } from "lucide-react";
6
6
  import { FeatureFlagProvider as l, useFeatureFlags as u } from "@burdenoff/fe-libs/shared/feature-flags";
7
- import { jsx as d } from "react/jsx-runtime";
7
+ import { useHeadingDocumentTitle as d } from "@burdenoff/fe-libs/ui";
8
+ import { jsx as f } from "react/jsx-runtime";
8
9
  // src/WorkspacesRoot.tsx
9
- var f = (f) => {
10
- let { registerNavItems: p, registerFooterItems: m, basePath: h = "/" } = f, { isEnabled: g, evaluations: _ } = u(), v = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`), y = i(() => ({
11
- isEnabled: g,
12
- evaluations: _
13
- }), [_, g]);
10
+ var p = (p) => {
11
+ let { registerNavItems: m, registerFooterItems: h, basePath: g = "/" } = p, { isEnabled: _, evaluations: v } = u();
12
+ d({
13
+ enabled: p.variant === "fluidgrids",
14
+ suffix: "FluidGrids"
15
+ });
16
+ let y = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`), b = i(() => ({
17
+ isEnabled: _,
18
+ evaluations: v
19
+ }), [v, _]);
14
20
  return r(() => {
15
- if (!p) return;
21
+ if (!m) return;
16
22
  let e = [
17
23
  {
18
24
  id: "workspaces-all",
19
25
  label: "All Workspaces",
20
- path: v(h, "list"),
21
- icon: /* @__PURE__ */ d(o, { size: 20 }),
26
+ path: y(g, "list"),
27
+ icon: /* @__PURE__ */ f(o, { size: 20 }),
22
28
  order: 10,
23
29
  group: "workspaces"
24
30
  },
25
31
  {
26
32
  id: "workspaces-projects",
27
33
  label: "Projects",
28
- path: v(h, "projects"),
29
- icon: /* @__PURE__ */ d(s, { size: 20 }),
34
+ path: y(g, "projects"),
35
+ icon: /* @__PURE__ */ f(s, { size: 20 }),
30
36
  order: 20,
31
37
  group: "workspaces"
32
38
  },
33
39
  {
34
40
  id: "workspaces-members",
35
41
  label: "Members",
36
- path: v(h, "members"),
37
- icon: /* @__PURE__ */ d(c, { size: 20 }),
42
+ path: y(g, "members"),
43
+ icon: /* @__PURE__ */ f(c, { size: 20 }),
38
44
  order: 30,
39
45
  group: "workspaces"
40
46
  },
41
47
  {
42
48
  id: "workspaces-activity",
43
49
  label: "Activity",
44
- path: v(h, "activity"),
45
- icon: /* @__PURE__ */ d(a, { size: 20 }),
50
+ path: y(g, "activity"),
51
+ icon: /* @__PURE__ */ f(a, { size: 20 }),
46
52
  order: 40,
47
53
  group: "workspaces"
48
54
  }
49
55
  ];
50
- return p(e);
56
+ return m(e);
51
57
  }, [
52
- p,
53
- h,
54
- y
58
+ m,
59
+ g,
60
+ b
55
61
  ]), r(() => {
56
- if (m) return m([{
62
+ if (h) return h([{
57
63
  id: "workspaces-status",
58
64
  label: "Workspaces Ready",
59
65
  type: "status",
60
66
  order: 10,
61
67
  section: "left"
62
68
  }]);
63
- }, [m]), /* @__PURE__ */ d(l, {
69
+ }, [h]), /* @__PURE__ */ f(l, {
64
70
  workspaceId: null,
65
71
  gateway: "global",
66
72
  defaultEnabled: !0,
67
- children: /* @__PURE__ */ d(t, { children: /* @__PURE__ */ d(e, {
68
- ...f,
69
- children: /* @__PURE__ */ d(n, {})
73
+ children: /* @__PURE__ */ f(t, { children: /* @__PURE__ */ f(e, {
74
+ ...p,
75
+ children: /* @__PURE__ */ f(n, {})
70
76
  }) })
71
77
  });
72
78
  };
73
- export { f as WorkspacesRoot };
79
+ export { p as WorkspacesRoot };
@@ -1,130 +1,131 @@
1
1
  import { useWorkspacesContext as e } from "./providers/WorkspacesProvider.js";
2
2
  import { WorkspaceContextPathSync as t } from "./components/WorkspaceContextPathSync.js";
3
- import { WorkspacesListPage as n } from "./pages/WorkspacesListPage.js";
4
- import { Suspense as r, lazy as i } from "react";
5
- import { FeatureGate as a } from "@burdenoff/fe-libs/shared/feature-flags";
6
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { Navigate as c, Route as l, Routes as u } from "react-router";
3
+ import { PendingInvitesRoute as n } from "./components/PendingInvitesRoute.js";
4
+ import { WorkspacesListPage as r } from "./pages/WorkspacesListPage.js";
5
+ import { Suspense as i, lazy as a } from "react";
6
+ import { FeatureGate as o } from "@burdenoff/fe-libs/shared/feature-flags";
7
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
+ import { Navigate as l, Route as u, Routes as d } from "react-router";
8
9
  // src/WorkspacesRoutes.tsx
9
- var d = i(() => import("./pages/CreateWorkspacePage.js").then((e) => ({ default: e.CreateWorkspacePage }))), f = i(() => import("./pages/WorkspaceDetailPage.js").then((e) => ({ default: e.WorkspaceDetailPage }))), p = i(() => import("./pages/WorkspaceSettingsPage.js").then((e) => ({ default: e.WorkspaceSettingsPage }))), m = i(() => import("./pages/ProjectsListPage.js").then((e) => ({ default: e.ProjectsListPage }))), h = i(() => import("./pages/ProjectDetailPage.js").then((e) => ({ default: e.ProjectDetailPage }))), g = i(() => import("./pages/ProjectMembersPage.js").then((e) => ({ default: e.ProjectMembersPage }))), _ = i(() => import("./pages/MembersListPage.js").then((e) => ({ default: e.MembersListPage }))), v = i(() => import("./pages/ActivityListPage.js").then((e) => ({ default: e.ActivityListPage }))), y = i(() => import("./pages/InviteAcceptancePage.js").then((e) => ({ default: e.InviteAcceptancePage }))), b = i(() => import("./pages/PendingInvitesPage.js").then((e) => ({ default: e.PendingInvitesPage }))), x = i(() => import("./pages/WorkspaceInvitePage.js").then((e) => ({ default: e.WorkspaceInvitePage })));
10
+ var f = a(() => import("./pages/CreateWorkspacePage.js").then((e) => ({ default: e.CreateWorkspacePage }))), p = a(() => import("./pages/WorkspaceDetailPage.js").then((e) => ({ default: e.WorkspaceDetailPage }))), m = a(() => import("./pages/WorkspaceSettingsPage.js").then((e) => ({ default: e.WorkspaceSettingsPage }))), h = a(() => import("./pages/ProjectsListPage.js").then((e) => ({ default: e.ProjectsListPage }))), g = a(() => import("./pages/ProjectDetailPage.js").then((e) => ({ default: e.ProjectDetailPage }))), _ = a(() => import("./pages/ProjectMembersPage.js").then((e) => ({ default: e.ProjectMembersPage }))), v = a(() => import("./pages/MembersListPage.js").then((e) => ({ default: e.MembersListPage }))), y = a(() => import("./pages/ActivityListPage.js").then((e) => ({ default: e.ActivityListPage }))), b = a(() => import("./pages/InviteAcceptancePage.js").then((e) => ({ default: e.InviteAcceptancePage }))), x = a(() => import("./pages/WorkspaceInvitePage.js").then((e) => ({ default: e.WorkspaceInvitePage })));
10
11
  function S() {
11
- return /* @__PURE__ */ o("div", {
12
+ return /* @__PURE__ */ s("div", {
12
13
  className: "flex items-center justify-center h-64",
13
- children: /* @__PURE__ */ o("div", { className: "animate-spin rounded-full size-8 border-b-2 border-primary" })
14
+ children: /* @__PURE__ */ s("div", { className: "animate-spin rounded-full size-8 border-b-2 border-primary" })
14
15
  });
15
16
  }
16
17
  function C() {
17
- return /* @__PURE__ */ o("div", {
18
+ return /* @__PURE__ */ s("div", {
18
19
  className: "flex h-full items-center justify-center p-8 text-center",
19
- children: /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h2", {
20
+ children: /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
20
21
  className: "text-lg font-semibold mb-2 text-text-primary",
21
22
  children: "Feature Not Available"
22
- }), /* @__PURE__ */ o("p", {
23
+ }), /* @__PURE__ */ s("p", {
23
24
  className: "text-sm text-text-secondary",
24
25
  children: "This feature is not currently available. Enable it under Feature Previews to access this functionality."
25
26
  })] })
26
27
  });
27
28
  }
28
29
  function w(e, t, n = !1) {
29
- return /* @__PURE__ */ o(a, {
30
+ return /* @__PURE__ */ s(o, {
30
31
  flag: e,
31
32
  defaultValue: n,
32
- fallback: /* @__PURE__ */ o(C, {}),
33
+ fallback: /* @__PURE__ */ s(C, {}),
33
34
  children: t
34
35
  });
35
36
  }
36
37
  function T() {
37
38
  let { basePath: t = "/workspaces" } = e();
38
- return /* @__PURE__ */ o(c, {
39
+ return /* @__PURE__ */ s(l, {
39
40
  to: `${t}/list`,
40
41
  replace: !0
41
42
  });
42
43
  }
43
44
  function E() {
44
45
  let { basePath: t = "/workspaces", workspaceId: n } = e();
45
- return n ? /* @__PURE__ */ o(c, {
46
+ return n ? /* @__PURE__ */ s(l, {
46
47
  to: `${t}/${n}/invite`,
47
48
  replace: !0
48
- }) : /* @__PURE__ */ o(x, {});
49
+ }) : /* @__PURE__ */ s(x, {});
49
50
  }
50
51
  function D() {
51
- return /* @__PURE__ */ s(r, {
52
- fallback: /* @__PURE__ */ o(S, {}),
53
- children: [/* @__PURE__ */ o(t, {}), /* @__PURE__ */ s(u, { children: [
54
- /* @__PURE__ */ o(l, {
52
+ return /* @__PURE__ */ c(i, {
53
+ fallback: /* @__PURE__ */ s(S, {}),
54
+ children: [/* @__PURE__ */ s(t, {}), /* @__PURE__ */ c(d, { children: [
55
+ /* @__PURE__ */ s(u, {
55
56
  index: !0,
56
- element: /* @__PURE__ */ o(c, {
57
+ element: /* @__PURE__ */ s(l, {
57
58
  to: "list",
58
59
  replace: !0
59
60
  })
60
61
  }),
61
- /* @__PURE__ */ o(l, {
62
+ /* @__PURE__ */ s(u, {
62
63
  path: "list",
63
- element: /* @__PURE__ */ o(n, {})
64
+ element: /* @__PURE__ */ s(r, {})
64
65
  }),
65
- /* @__PURE__ */ o(l, {
66
+ /* @__PURE__ */ s(u, {
66
67
  path: "new",
67
- element: /* @__PURE__ */ o(d, {})
68
+ element: /* @__PURE__ */ s(f, {})
68
69
  }),
69
- /* @__PURE__ */ o(l, {
70
+ /* @__PURE__ */ s(u, {
70
71
  path: "invites",
71
- element: /* @__PURE__ */ o(b, {})
72
+ element: /* @__PURE__ */ s(n, {})
72
73
  }),
73
- /* @__PURE__ */ o(l, {
74
+ /* @__PURE__ */ s(u, {
74
75
  path: "invite",
75
- element: /* @__PURE__ */ o(E, {})
76
+ element: /* @__PURE__ */ s(E, {})
76
77
  }),
77
- /* @__PURE__ */ o(l, {
78
+ /* @__PURE__ */ s(u, {
78
79
  path: "invite/:invitationId",
79
- element: /* @__PURE__ */ o(y, {})
80
+ element: /* @__PURE__ */ s(b, {})
80
81
  }),
81
- /* @__PURE__ */ o(l, {
82
+ /* @__PURE__ */ s(u, {
82
83
  path: ":workspaceId",
83
- element: /* @__PURE__ */ o(f, {})
84
+ element: /* @__PURE__ */ s(p, {})
84
85
  }),
85
- /* @__PURE__ */ o(l, {
86
+ /* @__PURE__ */ s(u, {
86
87
  path: ":workspaceId/settings",
87
- element: w("workspaces.settings", /* @__PURE__ */ o(p, {}), !0)
88
+ element: w("workspaces.settings", /* @__PURE__ */ s(m, {}), !0)
88
89
  }),
89
- /* @__PURE__ */ o(l, {
90
+ /* @__PURE__ */ s(u, {
90
91
  path: ":workspaceId/invite",
91
- element: /* @__PURE__ */ o(x, {})
92
+ element: /* @__PURE__ */ s(x, {})
92
93
  }),
93
- /* @__PURE__ */ o(l, {
94
+ /* @__PURE__ */ s(u, {
94
95
  path: "projects",
95
- element: /* @__PURE__ */ o(m, {})
96
+ element: /* @__PURE__ */ s(h, {})
96
97
  }),
97
- /* @__PURE__ */ o(l, {
98
+ /* @__PURE__ */ s(u, {
98
99
  path: ":workspaceId/projects",
99
- element: /* @__PURE__ */ o(m, {})
100
+ element: /* @__PURE__ */ s(h, {})
100
101
  }),
101
- /* @__PURE__ */ o(l, {
102
+ /* @__PURE__ */ s(u, {
102
103
  path: ":workspaceId/projects/:projectId",
103
- element: /* @__PURE__ */ o(h, {})
104
+ element: /* @__PURE__ */ s(g, {})
104
105
  }),
105
- /* @__PURE__ */ o(l, {
106
+ /* @__PURE__ */ s(u, {
106
107
  path: ":workspaceId/projects/:projectId/members",
107
- element: /* @__PURE__ */ o(g, {})
108
+ element: /* @__PURE__ */ s(_, {})
108
109
  }),
109
- /* @__PURE__ */ o(l, {
110
+ /* @__PURE__ */ s(u, {
110
111
  path: "members",
111
- element: /* @__PURE__ */ o(_, {})
112
+ element: /* @__PURE__ */ s(v, {})
112
113
  }),
113
- /* @__PURE__ */ o(l, {
114
+ /* @__PURE__ */ s(u, {
114
115
  path: ":workspaceId/members",
115
- element: /* @__PURE__ */ o(_, {})
116
+ element: /* @__PURE__ */ s(v, {})
116
117
  }),
117
- /* @__PURE__ */ o(l, {
118
+ /* @__PURE__ */ s(u, {
118
119
  path: "activity",
119
- element: /* @__PURE__ */ o(v, {})
120
+ element: /* @__PURE__ */ s(y, {})
120
121
  }),
121
- /* @__PURE__ */ o(l, {
122
+ /* @__PURE__ */ s(u, {
122
123
  path: ":workspaceId/activity",
123
- element: /* @__PURE__ */ o(v, {})
124
+ element: /* @__PURE__ */ s(y, {})
124
125
  }),
125
- /* @__PURE__ */ o(l, {
126
+ /* @__PURE__ */ s(u, {
126
127
  path: "*",
127
- element: /* @__PURE__ */ o(T, {})
128
+ element: /* @__PURE__ */ s(T, {})
128
129
  })
129
130
  ] })]
130
131
  });
@@ -1,111 +1,114 @@
1
1
  import { useWorkspacesStore as e } from "../store/workspacesStore.js";
2
2
  import { useCreateProject as t } from "../hooks/useProjectMutations.js";
3
3
  import { useTr as n } from "../hooks/useTr.js";
4
- import { useMemo as r } from "react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { Button as o, ResponsiveDialog as s, ResponsiveDialogContent as c, ResponsiveDialogDescription as l, ResponsiveDialogHeader as u, ResponsiveDialogTitle as d } from "@burdenoff/fe-libs/ui";
7
- import { FormControl as f, FormDescription as p, FormField as m, FormItem as h, FormLabel as g, FormMessage as _, FormProvider as v, Input as y, Textarea as b, useForm as x, z as S } from "@burdenoff/fe-libs/form";
4
+ import { useIsFluidGridsVariant as r } from "../providers/WorkspacesProvider.js";
5
+ import { buildCreateProjectInput as i, generateProjectKey as a } from "../utils/createForms.js";
6
+ import { useMemo as o } from "react";
7
+ import { Button as s, OptionalFields as c, ResponsiveDialog as l, ResponsiveDialogContent as u, ResponsiveDialogDescription as d, ResponsiveDialogHeader as f, ResponsiveDialogTitle as p } from "@burdenoff/fe-libs/ui";
8
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { FormControl as _, FormDescription as v, FormField as y, FormItem as b, FormLabel as x, FormMessage as S, FormProvider as C, Input as w, Textarea as T, useForm as E, z as D } from "@burdenoff/fe-libs/form";
8
10
  // src/components/CreateProjectDialog.tsx
9
- function C(e) {
10
- return S.object({
11
- name: S.string().min(2, e("createProjectDialog.validation.nameMin", "Name must be at least 2 characters")).max(100, e("createProjectDialog.validation.nameMax", "Name must be less than 100 characters")),
12
- key: S.string().min(2, e("createProjectDialog.validation.keyMin", "Key must be at least 2 characters")).max(10, e("createProjectDialog.validation.keyMax", "Key must be less than 10 characters")).regex(/^[A-Z0-9_-]+$/, e("createProjectDialog.validation.keyFormat", "Key must be uppercase letters, numbers, underscores, or hyphens")),
13
- description: S.string().optional()
11
+ function O(e) {
12
+ return D.object({
13
+ name: D.string().min(2, e("createProjectDialog.validation.nameMin", "Name must be at least 2 characters")).max(100, e("createProjectDialog.validation.nameMax", "Name must be less than 100 characters")),
14
+ key: D.string().min(2, e("createProjectDialog.validation.keyMin", "Key must be at least 2 characters")).max(10, e("createProjectDialog.validation.keyMax", "Key must be less than 10 characters")).regex(/^[A-Z0-9_-]+$/, e("createProjectDialog.validation.keyFormat", "Key must be uppercase letters, numbers, underscores, or hyphens")),
15
+ description: D.string().optional()
14
16
  });
15
17
  }
16
- function w({ workspaceId: S }) {
17
- let w = n(), { isCreateProjectDialogOpen: T, closeCreateProjectDialog: E } = e(), { mutate: D, isPending: O } = t(S), k = r(() => C(w), [w]), A = x({
18
- schema: k,
18
+ function k({ workspaceId: D }) {
19
+ let k = n(), A = r(), { isCreateProjectDialogOpen: j, closeCreateProjectDialog: M } = e(), { mutate: N, isPending: P } = t(D), F = o(() => O(k), [k]), I = E({
20
+ schema: F,
19
21
  defaultValues: {
20
22
  name: "",
21
23
  key: "",
22
24
  description: ""
23
25
  }
24
- }), j = (e) => {
25
- let t = {
26
- name: e.name,
27
- key: e.key,
28
- config: e.description ? { description: e.description } : void 0
29
- };
30
- D(t, {
26
+ }), L = (e) => {
27
+ let t = i(e);
28
+ N(t, {
31
29
  onSuccess: () => {
32
- E(), A.reset();
30
+ M(), I.reset();
33
31
  },
34
32
  onError: (e) => {
35
33
  console.error("Failed to create project:", e);
36
34
  }
37
35
  });
38
- }, M = (e) => {
39
- e || (E(), A.reset());
40
- }, N = (e) => {
41
- let t = e.toUpperCase().replace(/[^A-Z0-9\s]/g, "").replace(/\s+/g, "_").slice(0, 10);
42
- A.getValues("key") || A.setValue("key", t);
43
- };
44
- return /* @__PURE__ */ i(s, {
45
- open: T,
46
- onOpenChange: M,
47
- children: /* @__PURE__ */ a(c, {
36
+ }, R = (e) => {
37
+ e || (M(), I.reset());
38
+ }, z = !!I.formState.dirtyFields.key, B = (e) => {
39
+ z || I.setValue("key", a(e), { shouldValidate: I.formState.isSubmitted });
40
+ }, V = /* @__PURE__ */ h(y, {
41
+ control: I.control,
42
+ name: "key",
43
+ render: ({ field: e }) => /* @__PURE__ */ g(b, { children: [
44
+ /* @__PURE__ */ h(x, { children: k("createProjectDialog.keyLabel", "Project Key") }),
45
+ /* @__PURE__ */ h(_, { children: /* @__PURE__ */ h(w, {
46
+ ...e,
47
+ placeholder: k("createProjectDialog.keyPlaceholder", "MYPROJ")
48
+ }) }),
49
+ /* @__PURE__ */ h(v, { children: k("createProjectDialog.keyHint", "Short identifier (uppercase letters, numbers, underscores)") }),
50
+ /* @__PURE__ */ h(S, {})
51
+ ] })
52
+ }), H = /* @__PURE__ */ h(y, {
53
+ control: I.control,
54
+ name: "description",
55
+ render: ({ field: e }) => /* @__PURE__ */ g(b, { children: [
56
+ /* @__PURE__ */ h(x, { children: k("createProjectDialog.descriptionLabel", "Description (Optional)") }),
57
+ /* @__PURE__ */ h(_, { children: /* @__PURE__ */ h(T, {
58
+ ...e,
59
+ placeholder: k("createProjectDialog.descriptionPlaceholder", "Brief description of the project"),
60
+ rows: 3
61
+ }) }),
62
+ /* @__PURE__ */ h(S, {})
63
+ ] })
64
+ });
65
+ return /* @__PURE__ */ h(l, {
66
+ open: j,
67
+ onOpenChange: R,
68
+ children: /* @__PURE__ */ g(u, {
48
69
  className: "sm:max-w-[500px]",
49
- children: [/* @__PURE__ */ a(u, { children: [/* @__PURE__ */ i(d, { children: w("createProjectDialog.title", "Create Project") }), /* @__PURE__ */ i(l, { children: w("createProjectDialog.description", "Create a new project in your workspace. Projects help organize your work.") })] }), /* @__PURE__ */ i(v, {
50
- ...A,
51
- children: /* @__PURE__ */ a("form", {
52
- onSubmit: A.handleSubmit(j),
70
+ children: [/* @__PURE__ */ g(f, { children: [/* @__PURE__ */ h(p, { children: k("createProjectDialog.title", "Create Project") }), /* @__PURE__ */ h(d, { children: k("createProjectDialog.description", "Create a new project in your workspace. Projects help organize your work.") })] }), /* @__PURE__ */ h(C, {
71
+ ...I,
72
+ children: /* @__PURE__ */ g("form", {
73
+ onSubmit: I.handleSubmit(L),
53
74
  className: "space-y-4",
54
75
  children: [
55
- /* @__PURE__ */ i(m, {
56
- control: A.control,
76
+ /* @__PURE__ */ h(y, {
77
+ control: I.control,
57
78
  name: "name",
58
- render: ({ field: e }) => /* @__PURE__ */ a(h, { children: [
59
- /* @__PURE__ */ i(g, { children: w("createProjectDialog.nameLabel", "Project Name") }),
60
- /* @__PURE__ */ i(f, { children: /* @__PURE__ */ i(y, {
79
+ render: ({ field: e }) => /* @__PURE__ */ g(b, { children: [
80
+ /* @__PURE__ */ h(x, { children: k("createProjectDialog.nameLabel", "Project Name") }),
81
+ /* @__PURE__ */ h(_, { children: /* @__PURE__ */ h(w, {
61
82
  ...e,
62
- placeholder: w("createProjectDialog.namePlaceholder", "My Project"),
83
+ placeholder: k("createProjectDialog.namePlaceholder", "My Project"),
63
84
  onChange: (t) => {
64
- e.onChange(t), N(t.target.value);
85
+ e.onChange(t), B(t.target.value);
65
86
  }
66
87
  }) }),
67
- /* @__PURE__ */ i(p, { children: w("createProjectDialog.nameHint", "A descriptive name for your project") }),
68
- /* @__PURE__ */ i(_, {})
69
- ] })
70
- }),
71
- /* @__PURE__ */ i(m, {
72
- control: A.control,
73
- name: "key",
74
- render: ({ field: e }) => /* @__PURE__ */ a(h, { children: [
75
- /* @__PURE__ */ i(g, { children: w("createProjectDialog.keyLabel", "Project Key") }),
76
- /* @__PURE__ */ i(f, { children: /* @__PURE__ */ i(y, {
77
- ...e,
78
- placeholder: w("createProjectDialog.keyPlaceholder", "MYPROJ")
79
- }) }),
80
- /* @__PURE__ */ i(p, { children: w("createProjectDialog.keyHint", "Short identifier (uppercase letters, numbers, underscores)") }),
81
- /* @__PURE__ */ i(_, {})
82
- ] })
83
- }),
84
- /* @__PURE__ */ i(m, {
85
- control: A.control,
86
- name: "description",
87
- render: ({ field: e }) => /* @__PURE__ */ a(h, { children: [
88
- /* @__PURE__ */ i(g, { children: w("createProjectDialog.descriptionLabel", "Description (Optional)") }),
89
- /* @__PURE__ */ i(f, { children: /* @__PURE__ */ i(b, {
90
- ...e,
91
- placeholder: w("createProjectDialog.descriptionPlaceholder", "Brief description of the project"),
92
- rows: 3
93
- }) }),
94
- /* @__PURE__ */ i(_, {})
88
+ /* @__PURE__ */ h(v, { children: k("createProjectDialog.nameHint", "A descriptive name for your project") }),
89
+ /* @__PURE__ */ h(S, {})
95
90
  ] })
96
91
  }),
97
- /* @__PURE__ */ a("div", {
92
+ A ? /* @__PURE__ */ g(m, { children: [I.formState.errors.key?.message ? /* @__PURE__ */ h("p", {
93
+ role: "alert",
94
+ className: "text-sm text-status-error-text",
95
+ children: I.formState.errors.key.message
96
+ }) : null, /* @__PURE__ */ g(c, {
97
+ storageKey: "workspaces.createProject",
98
+ children: [V, H]
99
+ })] }) : /* @__PURE__ */ g(m, { children: [V, H] }),
100
+ /* @__PURE__ */ g("div", {
98
101
  className: "flex justify-end gap-3 pt-4",
99
- children: [/* @__PURE__ */ i(o, {
102
+ children: [/* @__PURE__ */ h(s, {
100
103
  type: "button",
101
104
  variant: "outline",
102
- onClick: () => M(!1),
103
- disabled: O,
104
- children: w("common.cancel", "Cancel")
105
- }), /* @__PURE__ */ i(o, {
105
+ onClick: () => R(!1),
106
+ disabled: P,
107
+ children: k("common.cancel", "Cancel")
108
+ }), /* @__PURE__ */ h(s, {
106
109
  type: "submit",
107
- disabled: O,
108
- children: O ? w("createProjectDialog.creating", "Creating...") : w("createProjectDialog.submit", "Create Project")
110
+ disabled: P,
111
+ children: P ? k("createProjectDialog.creating", "Creating...") : k("createProjectDialog.submit", "Create Project")
109
112
  })]
110
113
  })
111
114
  ]
@@ -114,4 +117,4 @@ function w({ workspaceId: S }) {
114
117
  })
115
118
  });
116
119
  }
117
- export { w as CreateProjectDialog };
120
+ export { k as CreateProjectDialog };