@burdenoff/microfe-sandbox 2026.525.2 → 2026.527.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.
Files changed (133) hide show
  1. package/dist/sandbox/components/CountdownTimer.js +39 -47
  2. package/dist/sandbox/components/CountdownTimer.js.map +1 -1
  3. package/dist/sandbox/components/ExportSandboxesDialog.js +62 -60
  4. package/dist/sandbox/components/ExportSandboxesDialog.js.map +1 -1
  5. package/dist/sandbox/components/ExtendTTLModal.js +8 -2
  6. package/dist/sandbox/components/ExtendTTLModal.js.map +1 -1
  7. package/dist/sandbox/components/FilesFolderPicker.js +53 -53
  8. package/dist/sandbox/components/FilesFolderPicker.js.map +1 -1
  9. package/dist/sandbox/components/RouteUtils.js +3 -3
  10. package/dist/sandbox/components/RouteUtils.js.map +1 -1
  11. package/dist/sandbox/components/SandboxActivityTab.js +0 -2
  12. package/dist/sandbox/components/SandboxActivityTab.js.map +1 -1
  13. package/dist/sandbox/components/SandboxUsageBanner.js +1 -2
  14. package/dist/sandbox/components/SandboxUsageBanner.js.map +1 -1
  15. package/dist/sandbox/components/StatusBadge.js +1 -2
  16. package/dist/sandbox/components/StatusBadge.js.map +1 -1
  17. package/dist/sandbox/components/TagsInput.js +2 -2
  18. package/dist/sandbox/components/TagsInput.js.map +1 -1
  19. package/dist/sandbox/pages/AdminPage.js +82 -78
  20. package/dist/sandbox/pages/AdminPage.js.map +1 -1
  21. package/dist/sandbox/pages/AdminTemplatesPage.js +1 -1
  22. package/dist/sandbox/pages/AdminTemplatesPage.js.map +1 -1
  23. package/dist/sandbox/pages/SandboxCreatePage.js +294 -249
  24. package/dist/sandbox/pages/SandboxCreatePage.js.map +1 -1
  25. package/dist/sandbox/pages/SandboxDetailPage.js +374 -339
  26. package/dist/sandbox/pages/SandboxDetailPage.js.map +1 -1
  27. package/dist/sandbox/pages/SandboxListPage.js +2 -1
  28. package/dist/sandbox/pages/SandboxListPage.js.map +1 -1
  29. package/dist/sandbox/pages/TemplateDetailPage.js +199 -150
  30. package/dist/sandbox/pages/TemplateDetailPage.js.map +1 -1
  31. package/dist/sandbox/pages/UserTemplatesPage.js +1 -1
  32. package/dist/sandbox/pages/UserTemplatesPage.js.map +1 -1
  33. package/dist/sandbox/providers/SandboxProvider.js +1 -1
  34. package/dist/sandbox/providers/SandboxProvider.js.map +1 -1
  35. package/package.json +1 -1
  36. package/dist/dev/main.d.ts +0 -2
  37. package/dist/dev/main.d.ts.map +0 -1
  38. package/dist/generated/global-operations.d.ts +0 -2
  39. package/dist/generated/global-operations.d.ts.map +0 -1
  40. package/dist/generated/global-types.d.ts +0 -23527
  41. package/dist/generated/global-types.d.ts.map +0 -1
  42. package/dist/generated/wspace-operations.d.ts +0 -1679
  43. package/dist/generated/wspace-operations.d.ts.map +0 -1
  44. package/dist/generated/wspace-types.d.ts +0 -57853
  45. package/dist/generated/wspace-types.d.ts.map +0 -1
  46. package/dist/index.d.ts +0 -6
  47. package/dist/index.d.ts.map +0 -1
  48. package/dist/sandbox/AdminRoutes.d.ts +0 -12
  49. package/dist/sandbox/AdminRoutes.d.ts.map +0 -1
  50. package/dist/sandbox/SandboxAdminRoot.d.ts +0 -21
  51. package/dist/sandbox/SandboxAdminRoot.d.ts.map +0 -1
  52. package/dist/sandbox/SandboxRoot.d.ts +0 -31
  53. package/dist/sandbox/SandboxRoot.d.ts.map +0 -1
  54. package/dist/sandbox/SandboxRoutes.d.ts +0 -18
  55. package/dist/sandbox/SandboxRoutes.d.ts.map +0 -1
  56. package/dist/sandbox/UserRoutes.d.ts +0 -11
  57. package/dist/sandbox/UserRoutes.d.ts.map +0 -1
  58. package/dist/sandbox/components/ContainerImagePicker.d.ts +0 -24
  59. package/dist/sandbox/components/ContainerImagePicker.d.ts.map +0 -1
  60. package/dist/sandbox/components/CountdownTimer.d.ts +0 -9
  61. package/dist/sandbox/components/CountdownTimer.d.ts.map +0 -1
  62. package/dist/sandbox/components/ExportSandboxesDialog.d.ts +0 -8
  63. package/dist/sandbox/components/ExportSandboxesDialog.d.ts.map +0 -1
  64. package/dist/sandbox/components/ExtendTTLModal.d.ts +0 -10
  65. package/dist/sandbox/components/ExtendTTLModal.d.ts.map +0 -1
  66. package/dist/sandbox/components/FilesFolderPicker.d.ts +0 -22
  67. package/dist/sandbox/components/FilesFolderPicker.d.ts.map +0 -1
  68. package/dist/sandbox/components/PageLayout.d.ts +0 -39
  69. package/dist/sandbox/components/PageLayout.d.ts.map +0 -1
  70. package/dist/sandbox/components/ResourceDisplay.d.ts +0 -17
  71. package/dist/sandbox/components/ResourceDisplay.d.ts.map +0 -1
  72. package/dist/sandbox/components/RouteUtils.d.ts +0 -28
  73. package/dist/sandbox/components/RouteUtils.d.ts.map +0 -1
  74. package/dist/sandbox/components/SandboxActivityTab.d.ts +0 -14
  75. package/dist/sandbox/components/SandboxActivityTab.d.ts.map +0 -1
  76. package/dist/sandbox/components/SandboxAgentAppPanel.d.ts +0 -16
  77. package/dist/sandbox/components/SandboxAgentAppPanel.d.ts.map +0 -1
  78. package/dist/sandbox/components/SandboxTypeIcon.d.ts +0 -15
  79. package/dist/sandbox/components/SandboxTypeIcon.d.ts.map +0 -1
  80. package/dist/sandbox/components/SandboxTypeSelector.d.ts +0 -35
  81. package/dist/sandbox/components/SandboxTypeSelector.d.ts.map +0 -1
  82. package/dist/sandbox/components/SandboxUsageBanner.d.ts +0 -16
  83. package/dist/sandbox/components/SandboxUsageBanner.d.ts.map +0 -1
  84. package/dist/sandbox/components/StatusBadge.d.ts +0 -15
  85. package/dist/sandbox/components/StatusBadge.d.ts.map +0 -1
  86. package/dist/sandbox/components/TagsInput.d.ts +0 -14
  87. package/dist/sandbox/components/TagsInput.d.ts.map +0 -1
  88. package/dist/sandbox/components/ui.d.ts +0 -6
  89. package/dist/sandbox/components/ui.d.ts.map +0 -1
  90. package/dist/sandbox/hooks/useRemainingSeconds.d.ts +0 -12
  91. package/dist/sandbox/hooks/useRemainingSeconds.d.ts.map +0 -1
  92. package/dist/sandbox/index.d.ts +0 -30
  93. package/dist/sandbox/index.d.ts.map +0 -1
  94. package/dist/sandbox/pages/AdminLandingPage.d.ts +0 -9
  95. package/dist/sandbox/pages/AdminLandingPage.d.ts.map +0 -1
  96. package/dist/sandbox/pages/AdminPage.d.ts +0 -2
  97. package/dist/sandbox/pages/AdminPage.d.ts.map +0 -1
  98. package/dist/sandbox/pages/AdminTemplatesPage.d.ts +0 -7
  99. package/dist/sandbox/pages/AdminTemplatesPage.d.ts.map +0 -1
  100. package/dist/sandbox/pages/SandboxCreatePage.d.ts +0 -2
  101. package/dist/sandbox/pages/SandboxCreatePage.d.ts.map +0 -1
  102. package/dist/sandbox/pages/SandboxDetailPage.d.ts +0 -6
  103. package/dist/sandbox/pages/SandboxDetailPage.d.ts.map +0 -1
  104. package/dist/sandbox/pages/SandboxLandingPage.d.ts +0 -12
  105. package/dist/sandbox/pages/SandboxLandingPage.d.ts.map +0 -1
  106. package/dist/sandbox/pages/SandboxListPage.d.ts +0 -6
  107. package/dist/sandbox/pages/SandboxListPage.d.ts.map +0 -1
  108. package/dist/sandbox/pages/TemplateDetailPage.d.ts +0 -6
  109. package/dist/sandbox/pages/TemplateDetailPage.d.ts.map +0 -1
  110. package/dist/sandbox/pages/TemplatesPage.d.ts +0 -8
  111. package/dist/sandbox/pages/TemplatesPage.d.ts.map +0 -1
  112. package/dist/sandbox/pages/UserLandingPage.d.ts +0 -9
  113. package/dist/sandbox/pages/UserLandingPage.d.ts.map +0 -1
  114. package/dist/sandbox/pages/UserTemplatesPage.d.ts +0 -8
  115. package/dist/sandbox/pages/UserTemplatesPage.d.ts.map +0 -1
  116. package/dist/sandbox/providers/SandboxProvider.d.ts +0 -13
  117. package/dist/sandbox/providers/SandboxProvider.d.ts.map +0 -1
  118. package/dist/sandbox/store/sandboxStore.d.ts +0 -16
  119. package/dist/sandbox/store/sandboxStore.d.ts.map +0 -1
  120. package/dist/sandbox/types/index.d.ts +0 -238
  121. package/dist/sandbox/types/index.d.ts.map +0 -1
  122. package/dist/sandbox/utils/cn.d.ts +0 -8
  123. package/dist/sandbox/utils/cn.d.ts.map +0 -1
  124. package/dist/sandbox/utils/formatters.d.ts +0 -7
  125. package/dist/sandbox/utils/formatters.d.ts.map +0 -1
  126. package/dist/sandbox/utils/i18n.d.ts +0 -6
  127. package/dist/sandbox/utils/i18n.d.ts.map +0 -1
  128. package/dist/sandbox/utils/navigation.d.ts +0 -5
  129. package/dist/sandbox/utils/navigation.d.ts.map +0 -1
  130. package/dist/sandbox/utils/sandboxEvents.d.ts +0 -13
  131. package/dist/sandbox/utils/sandboxEvents.d.ts.map +0 -1
  132. package/dist/utils/nativeBridge.d.ts +0 -3
  133. package/dist/utils/nativeBridge.d.ts.map +0 -1
@@ -1,90 +1,90 @@
1
1
  import { Button as e, Input as t } from "./ui.js";
2
2
  import { tWithFallback as n } from "../utils/i18n.js";
3
3
  import { useSandboxCreateFolderMutation as r, useSandboxGetFoldersQuery as i } from "../../generated/wspace-operations.js";
4
- import { useMemo as a, useState as o } from "react";
5
- import { AlertCircle as s, Check as c, Folder as l, FolderOpen as u, Loader2 as d, Plus as f } from "lucide-react";
6
- import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell";
7
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
4
+ import { useMemo as a, useRef as o, useState as s } from "react";
5
+ import { AlertCircle as c, Check as l, Folder as u, FolderOpen as d, Loader2 as f, Plus as p } from "lucide-react";
6
+ import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell";
7
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
8
8
  //#region src/sandbox/components/FilesFolderPicker.tsx
9
- var g = 20;
10
- function _({ value: _, onChange: v }) {
11
- let { t: y } = p(), [b, x] = o(0), [S, C] = o(!1), [w, T] = o(""), [E, D] = o(null), { data: O, loading: k, error: A, fetchMore: j, refetch: M } = i({
9
+ var _ = 20;
10
+ function v({ value: v, onChange: y }) {
11
+ let { t: b } = m(), x = o(0), [S, C] = s(!1), [w, T] = s(""), [E, D] = s(null), { data: O, loading: k, error: A, fetchMore: j, refetch: M } = i({
12
12
  variables: { pagination: {
13
- limit: g,
13
+ limit: _,
14
14
  offset: 0
15
15
  } },
16
16
  fetchPolicy: "cache-and-network",
17
17
  notifyOnNetworkStatusChange: !0
18
18
  }), [N, { loading: P }] = r(), F = a(() => O?.getFolders.folders ?? [], [O]), I = O?.getFolders.hasMore ?? !1;
19
- return /* @__PURE__ */ h("div", {
19
+ return /* @__PURE__ */ g("div", {
20
20
  className: "space-y-3",
21
21
  children: [
22
- /* @__PURE__ */ h("div", {
22
+ /* @__PURE__ */ g("div", {
23
23
  className: "flex items-center justify-between",
24
- children: [/* @__PURE__ */ m("label", {
24
+ children: [/* @__PURE__ */ h("label", {
25
25
  className: "block text-sm font-semibold",
26
- children: n(y, "sandbox.create.fields.filesFolder.label", "Export folder (files-svc)")
27
- }), _ !== null && /* @__PURE__ */ m("button", {
26
+ children: n(b, "sandbox.create.fields.filesFolder.label", "Export folder (files-svc)")
27
+ }), v !== null && /* @__PURE__ */ h("button", {
28
28
  type: "button",
29
- onClick: () => v(null),
29
+ onClick: () => y(null),
30
30
  className: "text-xs text-muted-foreground hover:text-foreground transition-colors",
31
- children: n(y, "sandbox.create.fields.filesFolder.clear", "Clear")
31
+ children: n(b, "sandbox.create.fields.filesFolder.clear", "Clear")
32
32
  })]
33
33
  }),
34
- /* @__PURE__ */ m("p", {
34
+ /* @__PURE__ */ h("p", {
35
35
  className: "text-xs text-muted-foreground",
36
- children: n(y, "sandbox.create.fields.filesFolder.help", "When the sandbox stops, the volume contents are best-effort copied to this folder. Leave empty to skip export.")
36
+ children: n(b, "sandbox.create.fields.filesFolder.help", "When the sandbox stops, the volume contents are best-effort copied to this folder. Leave empty to skip export.")
37
37
  }),
38
- A && /* @__PURE__ */ h("div", {
38
+ A && /* @__PURE__ */ g("div", {
39
39
  className: "flex items-center gap-2 text-xs text-destructive",
40
- children: [/* @__PURE__ */ m(s, { className: "w-4 h-4" }), A.message]
40
+ children: [/* @__PURE__ */ h(c, { className: "size-4" }), A.message]
41
41
  }),
42
- /* @__PURE__ */ h("div", {
42
+ /* @__PURE__ */ g("div", {
43
43
  className: "border-2 border-border rounded-lg bg-background max-h-56 overflow-y-auto",
44
- children: [k && F.length === 0 ? /* @__PURE__ */ h("div", {
44
+ children: [k && F.length === 0 ? /* @__PURE__ */ g("div", {
45
45
  className: "flex items-center justify-center py-6 text-muted-foreground",
46
- children: [/* @__PURE__ */ m(d, { className: "w-4 h-4 animate-spin mr-2" }), /* @__PURE__ */ m("span", {
46
+ children: [/* @__PURE__ */ h(f, { className: "size-4 animate-spin mr-2" }), /* @__PURE__ */ h("span", {
47
47
  className: "text-sm",
48
- children: n(y, "sandbox.create.fields.filesFolder.loading", "Loading folders…")
48
+ children: n(b, "sandbox.create.fields.filesFolder.loading", "Loading folders…")
49
49
  })]
50
- }) : F.length === 0 ? /* @__PURE__ */ m("div", {
50
+ }) : F.length === 0 ? /* @__PURE__ */ h("div", {
51
51
  className: "px-4 py-6 text-sm text-muted-foreground text-center",
52
- children: n(y, "sandbox.create.fields.filesFolder.empty", "No folders yet — create one below.")
53
- }) : /* @__PURE__ */ m("ul", {
52
+ children: n(b, "sandbox.create.fields.filesFolder.empty", "No folders yet — create one below.")
53
+ }) : /* @__PURE__ */ h("ul", {
54
54
  className: "divide-y divide-border",
55
55
  children: F.map((e) => {
56
- let t = e.id === _;
57
- return /* @__PURE__ */ m("li", { children: /* @__PURE__ */ h("button", {
56
+ let t = e.id === v;
57
+ return /* @__PURE__ */ h("li", { children: /* @__PURE__ */ g("button", {
58
58
  type: "button",
59
- onClick: () => v(e.id),
59
+ onClick: () => y(e.id),
60
60
  className: `w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-muted ${t ? "bg-primary/10" : ""}`,
61
61
  children: [
62
- t ? /* @__PURE__ */ m(u, { className: "w-4 h-4 text-primary" }) : /* @__PURE__ */ m(l, { className: "w-4 h-4 text-muted-foreground" }),
63
- /* @__PURE__ */ h("div", {
62
+ t ? /* @__PURE__ */ h(d, { className: "size-4 text-primary" }) : /* @__PURE__ */ h(u, { className: "size-4 text-muted-foreground" }),
63
+ /* @__PURE__ */ g("div", {
64
64
  className: "flex-1 min-w-0",
65
- children: [/* @__PURE__ */ m("p", {
65
+ children: [/* @__PURE__ */ h("p", {
66
66
  className: "text-sm font-medium truncate",
67
67
  children: e.name
68
- }), e.path && /* @__PURE__ */ m("p", {
68
+ }), e.path && /* @__PURE__ */ h("p", {
69
69
  className: "text-xs text-muted-foreground truncate",
70
70
  children: e.path
71
71
  })]
72
72
  }),
73
- t && /* @__PURE__ */ m(c, { className: "w-4 h-4 text-primary" })
73
+ t && /* @__PURE__ */ h(l, { className: "size-4 text-primary" })
74
74
  ]
75
75
  }) }, e.id);
76
76
  })
77
- }), I && /* @__PURE__ */ m("div", {
77
+ }), I && /* @__PURE__ */ h("div", {
78
78
  className: "border-t border-border p-2",
79
- children: /* @__PURE__ */ h(e, {
79
+ children: /* @__PURE__ */ g(e, {
80
80
  type: "button",
81
81
  variant: "ghost",
82
82
  size: "sm",
83
83
  onClick: async () => {
84
- let e = b + g;
84
+ let e = x.current + _;
85
85
  await j({
86
86
  variables: { pagination: {
87
- limit: g,
87
+ limit: _,
88
88
  offset: e
89
89
  } },
90
90
  updateQuery: (e, { fetchMoreResult: t }) => t ? {
@@ -94,25 +94,25 @@ function _({ value: _, onChange: v }) {
94
94
  folders: [...e.getFolders.folders, ...t.getFolders.folders]
95
95
  }
96
96
  } : e
97
- }), x(e);
97
+ }), x.current = e;
98
98
  },
99
99
  disabled: k,
100
100
  className: "w-full",
101
- children: [k ? /* @__PURE__ */ m(d, { className: "w-3 h-3 animate-spin mr-2" }) : null, n(y, "sandbox.create.fields.filesFolder.loadMore", "Load more")]
101
+ children: [k ? /* @__PURE__ */ h(f, { className: "size-3 animate-spin mr-2" }) : null, n(b, "sandbox.create.fields.filesFolder.loadMore", "Load more")]
102
102
  })
103
103
  })]
104
104
  }),
105
- S ? /* @__PURE__ */ h("div", {
105
+ S ? /* @__PURE__ */ g("div", {
106
106
  className: "flex items-center gap-2",
107
107
  children: [
108
- /* @__PURE__ */ m(t, {
108
+ /* @__PURE__ */ h(t, {
109
109
  value: w,
110
110
  onChange: (e) => T(e.target.value),
111
- placeholder: n(y, "sandbox.create.fields.filesFolder.newPlaceholder", "Folder name"),
111
+ placeholder: n(b, "sandbox.create.fields.filesFolder.newPlaceholder", "Folder name"),
112
112
  className: "flex-1",
113
113
  autoFocus: !0
114
114
  }),
115
- /* @__PURE__ */ h(e, {
115
+ /* @__PURE__ */ g(e, {
116
116
  type: "button",
117
117
  size: "sm",
118
118
  onClick: async () => {
@@ -121,40 +121,40 @@ function _({ value: _, onChange: v }) {
121
121
  D(null);
122
122
  try {
123
123
  let t = (await N({ variables: { input: { name: e } } })).data?.createFolder;
124
- t && (v(t.id), T(""), C(!1), await M());
124
+ t && (y(t.id), T(""), C(!1), await M());
125
125
  } catch (e) {
126
126
  D(e instanceof Error ? e.message : String(e));
127
127
  }
128
128
  }
129
129
  },
130
130
  disabled: P || w.trim().length === 0,
131
- children: [P ? /* @__PURE__ */ m(d, { className: "w-3 h-3 animate-spin mr-2" }) : null, n(y, "sandbox.create.fields.filesFolder.createConfirm", "Create")]
131
+ children: [P ? /* @__PURE__ */ h(f, { className: "size-3 animate-spin mr-2" }) : null, n(b, "sandbox.create.fields.filesFolder.createConfirm", "Create")]
132
132
  }),
133
- /* @__PURE__ */ m(e, {
133
+ /* @__PURE__ */ h(e, {
134
134
  type: "button",
135
135
  size: "sm",
136
136
  variant: "ghost",
137
137
  onClick: () => {
138
138
  C(!1), T(""), D(null);
139
139
  },
140
- children: n(y, "sandbox.create.fields.filesFolder.cancel", "Cancel")
140
+ children: n(b, "sandbox.create.fields.filesFolder.cancel", "Cancel")
141
141
  })
142
142
  ]
143
- }) : /* @__PURE__ */ h(e, {
143
+ }) : /* @__PURE__ */ g(e, {
144
144
  type: "button",
145
145
  variant: "outline",
146
146
  size: "sm",
147
147
  onClick: () => C(!0),
148
- children: [/* @__PURE__ */ m(f, { className: "w-3 h-3 mr-2" }), n(y, "sandbox.create.fields.filesFolder.createNew", "Create folder")]
148
+ children: [/* @__PURE__ */ h(p, { className: "size-3 mr-2" }), n(b, "sandbox.create.fields.filesFolder.createNew", "Create folder")]
149
149
  }),
150
- E && /* @__PURE__ */ h("div", {
150
+ E && /* @__PURE__ */ g("div", {
151
151
  className: "flex items-center gap-2 text-xs text-destructive",
152
- children: [/* @__PURE__ */ m(s, { className: "w-4 h-4" }), E]
152
+ children: [/* @__PURE__ */ h(c, { className: "size-4" }), E]
153
153
  })
154
154
  ]
155
155
  });
156
156
  }
157
157
  //#endregion
158
- export { _ as FilesFolderPicker };
158
+ export { v as FilesFolderPicker };
159
159
 
160
160
  //# sourceMappingURL=FilesFolderPicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilesFolderPicker.js","names":[],"sources":["../../../src/sandbox/components/FilesFolderPicker.tsx"],"sourcesContent":["import { useState, useMemo } from 'react';\nimport { FolderOpen, Folder, Plus, Loader2, Check, AlertCircle } from 'lucide-react';\nimport { Button, Input } from './ui';\nimport { tWithFallback } from '../utils/i18n';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n useSandboxGetFoldersQuery,\n useSandboxCreateFolderMutation,\n} from '../../generated/wspace-operations';\n\nconst PAGE_SIZE = 20;\n\ninterface FilesFolderPickerProps {\n /** Currently selected folder id (uncontrolled-leaning controlled). */\n value: string | null;\n /** Fired with the selected folder id (or null when cleared). */\n onChange: (folderId: string | null) => void;\n}\n\n/**\n * Picks a files-svc folder for sandbox volume export on stop.\n *\n * Behaviour:\n * - Lists folders from the workspaces gateway via `getFolders` (offset paging\n * — wspace.graphql exposes limit/offset, not cursor).\n * - \"Load more\" appends; \"Create folder\" inline action calls `createFolder`\n * and selects the newly created folder.\n * - Selection writes the folder id back through `onChange`.\n *\n * Styling sticks to semantic tokens (`bg-card`, `text-muted-foreground`,\n * `border-border`, `text-primary`) — no raw colours.\n */\nexport function FilesFolderPicker({ value, onChange }: FilesFolderPickerProps) {\n const { t } = useI18n();\n const [offset, setOffset] = useState(0);\n const [creating, setCreating] = useState(false);\n const [newFolderName, setNewFolderName] = useState('');\n const [createError, setCreateError] = useState<string | null>(null);\n\n const { data, loading, error, fetchMore, refetch } = useSandboxGetFoldersQuery({\n variables: { pagination: { limit: PAGE_SIZE, offset: 0 } },\n fetchPolicy: 'cache-and-network',\n notifyOnNetworkStatusChange: true,\n });\n\n const [createFolderMutation, { loading: createLoading }] = useSandboxCreateFolderMutation();\n\n interface FolderRow {\n id: string;\n name: string;\n path: string;\n parentFolderId?: string | null;\n }\n const folders: FolderRow[] = useMemo(\n () => (data?.getFolders.folders ?? []) as FolderRow[],\n [data]\n );\n const hasMore = data?.getFolders.hasMore ?? false;\n\n const handleLoadMore = async (): Promise<void> => {\n const next = offset + PAGE_SIZE;\n await fetchMore({\n variables: { pagination: { limit: PAGE_SIZE, offset: next } },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n ...fetchMoreResult,\n getFolders: {\n ...fetchMoreResult.getFolders,\n folders: [...prev.getFolders.folders, ...fetchMoreResult.getFolders.folders],\n },\n };\n },\n });\n setOffset(next);\n };\n\n const handleCreate = async (): Promise<void> => {\n const name = newFolderName.trim();\n if (!name) return;\n setCreateError(null);\n try {\n const result = await createFolderMutation({ variables: { input: { name } } });\n const created = result.data?.createFolder;\n if (created) {\n onChange(created.id);\n setNewFolderName('');\n setCreating(false);\n await refetch();\n }\n } catch (err) {\n setCreateError(err instanceof Error ? err.message : String(err));\n }\n };\n\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <label className=\"block text-sm font-semibold\">\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.label', 'Export folder (files-svc)')}\n </label>\n {value !== null && (\n <button\n type=\"button\"\n onClick={() => onChange(null)}\n className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"\n >\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.clear', 'Clear')}\n </button>\n )}\n </div>\n\n <p className=\"text-xs text-muted-foreground\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.filesFolder.help',\n 'When the sandbox stops, the volume contents are best-effort copied to this folder. Leave empty to skip export.'\n )}\n </p>\n\n {error && (\n <div className=\"flex items-center gap-2 text-xs text-destructive\">\n <AlertCircle className=\"w-4 h-4\" />\n {error.message}\n </div>\n )}\n\n <div className=\"border-2 border-border rounded-lg bg-background max-h-56 overflow-y-auto\">\n {loading && folders.length === 0 ? (\n <div className=\"flex items-center justify-center py-6 text-muted-foreground\">\n <Loader2 className=\"w-4 h-4 animate-spin mr-2\" />\n <span className=\"text-sm\">\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.loading', 'Loading folders…')}\n </span>\n </div>\n ) : folders.length === 0 ? (\n <div className=\"px-4 py-6 text-sm text-muted-foreground text-center\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.filesFolder.empty',\n 'No folders yet — create one below.'\n )}\n </div>\n ) : (\n <ul className=\"divide-y divide-border\">\n {folders.map((folder) => {\n const isSelected = folder.id === value;\n return (\n <li key={folder.id}>\n <button\n type=\"button\"\n onClick={() => onChange(folder.id)}\n className={`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-muted ${\n isSelected ? 'bg-primary/10' : ''\n }`}\n >\n {isSelected ? (\n <FolderOpen className=\"w-4 h-4 text-primary\" />\n ) : (\n <Folder className=\"w-4 h-4 text-muted-foreground\" />\n )}\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium truncate\">{folder.name}</p>\n {folder.path && (\n <p className=\"text-xs text-muted-foreground truncate\">{folder.path}</p>\n )}\n </div>\n {isSelected && <Check className=\"w-4 h-4 text-primary\" />}\n </button>\n </li>\n );\n })}\n </ul>\n )}\n\n {hasMore && (\n <div className=\"border-t border-border p-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleLoadMore}\n disabled={loading}\n className=\"w-full\"\n >\n {loading ? <Loader2 className=\"w-3 h-3 animate-spin mr-2\" /> : null}\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.loadMore', 'Load more')}\n </Button>\n </div>\n )}\n </div>\n\n {creating ? (\n <div className=\"flex items-center gap-2\">\n <Input\n value={newFolderName}\n onChange={(e) => setNewFolderName(e.target.value)}\n placeholder={tWithFallback(\n t,\n 'sandbox.create.fields.filesFolder.newPlaceholder',\n 'Folder name'\n )}\n className=\"flex-1\"\n autoFocus\n />\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={handleCreate}\n disabled={createLoading || newFolderName.trim().length === 0}\n >\n {createLoading ? <Loader2 className=\"w-3 h-3 animate-spin mr-2\" /> : null}\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.createConfirm', 'Create')}\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => {\n setCreating(false);\n setNewFolderName('');\n setCreateError(null);\n }}\n >\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.cancel', 'Cancel')}\n </Button>\n </div>\n ) : (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => setCreating(true)}>\n <Plus className=\"w-3 h-3 mr-2\" />\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.createNew', 'Create folder')}\n </Button>\n )}\n\n {createError && (\n <div className=\"flex items-center gap-2 text-xs text-destructive\">\n <AlertCircle className=\"w-4 h-4\" />\n {createError}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAY;AAsBlB,SAAgB,EAAkB,EAAE,UAAO,eAAoC;CAC7E,IAAM,EAAE,SAAM,GAAS,EACjB,CAAC,GAAQ,KAAa,EAAS,EAAE,EACjC,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAe,KAAoB,EAAS,GAAG,EAChD,CAAC,GAAa,KAAkB,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C,IAAM,IAAO,EAAc,MAAM;AAC5B,cACL;UAAe,KAAK;AACpB,YAAI;SAEF,IAAM,KADS,MAAM,EAAqB,EAAE,WAAW,EAAE,OAAO,EAAE,SAAM,EAAE,EAAE,CAAC,EACtD,MAAM;AAC7B,SAAI,MACF,EAAS,EAAQ,GAAG,EACpB,EAAiB,GAAG,EACpB,EAAY,GAAM,EAClB,MAAM,GAAS;iBAEV,GAAK;AACZ,WAAe,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CAAC;;;;MAsH1D,UAAU,KAAiB,EAAc,MAAM,CAAC,WAAW;gBAJ7D,CAMG,IAAgB,kBAAC,GAAD,EAAS,WAAU,6BAA8B,CAAA,GAAG,MACpE,EAAc,GAAG,mDAAmD,SAAS,CACvE;;KACT,kBAAC,GAAD;MACE,MAAK;MACL,MAAK;MACL,SAAQ;MACR,eAAe;AAGb,OAFA,EAAY,GAAM,EAClB,EAAiB,GAAG,EACpB,EAAe,KAAK;;gBAGrB,EAAc,GAAG,4CAA4C,SAAS;MAChE,CAAA;KACL;QAEN,kBAAC,GAAD;IAAQ,MAAK;IAAS,SAAQ;IAAU,MAAK;IAAK,eAAe,EAAY,GAAK;cAAlF,CACE,kBAAC,GAAD,EAAM,WAAU,gBAAiB,CAAA,EAChC,EAAc,GAAG,+CAA+C,gBAAgB,CAC1E;;GAGV,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAa,WAAU,WAAY,CAAA,EAClC,EACG;;GAEJ"}
1
+ {"version":3,"file":"FilesFolderPicker.js","names":[],"sources":["../../../src/sandbox/components/FilesFolderPicker.tsx"],"sourcesContent":["import { useState, useMemo, useRef } from 'react';\nimport { FolderOpen, Folder, Plus, Loader2, Check, AlertCircle } from 'lucide-react';\nimport { Button, Input } from './ui';\nimport { tWithFallback } from '../utils/i18n';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n useSandboxGetFoldersQuery,\n useSandboxCreateFolderMutation,\n} from '../../generated/wspace-operations';\n\nconst PAGE_SIZE = 20;\n\ninterface FilesFolderPickerProps {\n /** Currently selected folder id (uncontrolled-leaning controlled). */\n value: string | null;\n /** Fired with the selected folder id (or null when cleared). */\n onChange: (folderId: string | null) => void;\n}\n\n/**\n * Picks a files-svc folder for sandbox volume export on stop.\n *\n * Behaviour:\n * - Lists folders from the workspaces gateway via `getFolders` (offset paging\n * — wspace.graphql exposes limit/offset, not cursor).\n * - \"Load more\" appends; \"Create folder\" inline action calls `createFolder`\n * and selects the newly created folder.\n * - Selection writes the folder id back through `onChange`.\n *\n * Styling sticks to semantic tokens (`bg-card`, `text-muted-foreground`,\n * `border-border`, `text-primary`) — no raw colours.\n */\nexport function FilesFolderPicker({ value, onChange }: FilesFolderPickerProps) {\n const { t } = useI18n();\n const offsetRef = useRef(0);\n const [creating, setCreating] = useState(false);\n const [newFolderName, setNewFolderName] = useState('');\n const [createError, setCreateError] = useState<string | null>(null);\n\n const { data, loading, error, fetchMore, refetch } = useSandboxGetFoldersQuery({\n variables: { pagination: { limit: PAGE_SIZE, offset: 0 } },\n fetchPolicy: 'cache-and-network',\n notifyOnNetworkStatusChange: true,\n });\n\n const [createFolderMutation, { loading: createLoading }] = useSandboxCreateFolderMutation();\n\n interface FolderRow {\n id: string;\n name: string;\n path: string;\n parentFolderId?: string | null;\n }\n const folders: FolderRow[] = useMemo(\n () => (data?.getFolders.folders ?? []) as FolderRow[],\n [data]\n );\n const hasMore = data?.getFolders.hasMore ?? false;\n\n const handleLoadMore = async (): Promise<void> => {\n const next = offsetRef.current + PAGE_SIZE;\n await fetchMore({\n variables: { pagination: { limit: PAGE_SIZE, offset: next } },\n updateQuery: (prev, { fetchMoreResult }) => {\n if (!fetchMoreResult) return prev;\n return {\n ...fetchMoreResult,\n getFolders: {\n ...fetchMoreResult.getFolders,\n folders: [...prev.getFolders.folders, ...fetchMoreResult.getFolders.folders],\n },\n };\n },\n });\n offsetRef.current = next;\n };\n\n const handleCreate = async (): Promise<void> => {\n const name = newFolderName.trim();\n if (!name) return;\n setCreateError(null);\n try {\n const result = await createFolderMutation({ variables: { input: { name } } });\n const created = result.data?.createFolder;\n if (created) {\n onChange(created.id);\n setNewFolderName('');\n setCreating(false);\n await refetch();\n }\n } catch (err) {\n setCreateError(err instanceof Error ? err.message : String(err));\n }\n };\n\n return (\n <div className=\"space-y-3\">\n <div className=\"flex items-center justify-between\">\n <label className=\"block text-sm font-semibold\">\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.label', 'Export folder (files-svc)')}\n </label>\n {value !== null && (\n <button\n type=\"button\"\n onClick={() => onChange(null)}\n className=\"text-xs text-muted-foreground hover:text-foreground transition-colors\"\n >\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.clear', 'Clear')}\n </button>\n )}\n </div>\n\n <p className=\"text-xs text-muted-foreground\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.filesFolder.help',\n 'When the sandbox stops, the volume contents are best-effort copied to this folder. Leave empty to skip export.'\n )}\n </p>\n\n {error && (\n <div className=\"flex items-center gap-2 text-xs text-destructive\">\n <AlertCircle className=\"size-4\" />\n {error.message}\n </div>\n )}\n\n <div className=\"border-2 border-border rounded-lg bg-background max-h-56 overflow-y-auto\">\n {loading && folders.length === 0 ? (\n <div className=\"flex items-center justify-center py-6 text-muted-foreground\">\n <Loader2 className=\"size-4 animate-spin mr-2\" />\n <span className=\"text-sm\">\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.loading', 'Loading folders…')}\n </span>\n </div>\n ) : folders.length === 0 ? (\n <div className=\"px-4 py-6 text-sm text-muted-foreground text-center\">\n {tWithFallback(\n t,\n 'sandbox.create.fields.filesFolder.empty',\n 'No folders yet — create one below.'\n )}\n </div>\n ) : (\n <ul className=\"divide-y divide-border\">\n {folders.map((folder) => {\n const isSelected = folder.id === value;\n return (\n <li key={folder.id}>\n <button\n type=\"button\"\n onClick={() => onChange(folder.id)}\n className={`w-full flex items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-muted ${\n isSelected ? 'bg-primary/10' : ''\n }`}\n >\n {isSelected ? (\n <FolderOpen className=\"size-4 text-primary\" />\n ) : (\n <Folder className=\"size-4 text-muted-foreground\" />\n )}\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium truncate\">{folder.name}</p>\n {folder.path && (\n <p className=\"text-xs text-muted-foreground truncate\">{folder.path}</p>\n )}\n </div>\n {isSelected && <Check className=\"size-4 text-primary\" />}\n </button>\n </li>\n );\n })}\n </ul>\n )}\n\n {hasMore && (\n <div className=\"border-t border-border p-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onClick={handleLoadMore}\n disabled={loading}\n className=\"w-full\"\n >\n {loading ? <Loader2 className=\"size-3 animate-spin mr-2\" /> : null}\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.loadMore', 'Load more')}\n </Button>\n </div>\n )}\n </div>\n\n {creating ? (\n <div className=\"flex items-center gap-2\">\n <Input\n value={newFolderName}\n onChange={(e) => setNewFolderName(e.target.value)}\n placeholder={tWithFallback(\n t,\n 'sandbox.create.fields.filesFolder.newPlaceholder',\n 'Folder name'\n )}\n className=\"flex-1\"\n autoFocus\n />\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={handleCreate}\n disabled={createLoading || newFolderName.trim().length === 0}\n >\n {createLoading ? <Loader2 className=\"size-3 animate-spin mr-2\" /> : null}\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.createConfirm', 'Create')}\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => {\n setCreating(false);\n setNewFolderName('');\n setCreateError(null);\n }}\n >\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.cancel', 'Cancel')}\n </Button>\n </div>\n ) : (\n <Button type=\"button\" variant=\"outline\" size=\"sm\" onClick={() => setCreating(true)}>\n <Plus className=\"size-3 mr-2\" />\n {tWithFallback(t, 'sandbox.create.fields.filesFolder.createNew', 'Create folder')}\n </Button>\n )}\n\n {createError && (\n <div className=\"flex items-center gap-2 text-xs text-destructive\">\n <AlertCircle className=\"size-4\" />\n {createError}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAY;AAsBlB,SAAgB,EAAkB,EAAE,UAAO,eAAoC;CAC7E,IAAM,EAAE,SAAM,GAAS,EACjB,IAAY,EAAO,EAAE,EACrB,CAAC,GAAU,KAAe,EAAS,GAAM,EACzC,CAAC,GAAe,KAAoB,EAAS,GAAG,EAChD,CAAC,GAAa,KAAkB,EAAwB,KAAK,EAE7D,EAAE,SAAM,YAAS,UAAO,cAAW,eAAY,EAA0B;EAC7E,WAAW,EAAE,YAAY;GAAE,OAAO;GAAW,QAAQ;GAAG,EAAE;EAC1D,aAAa;EACb,6BAA6B;EAC9B,CAAC,EAEI,CAAC,GAAsB,EAAE,SAAS,OAAmB,GAAgC,EAQrF,IAAuB,QACpB,GAAM,WAAW,WAAW,EAAE,EACrC,CAAC,EAAK,CACP,EACK,IAAU,GAAM,WAAW,WAAW;AAsC5C,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,SAAD;KAAO,WAAU;eACd,EAAc,GAAG,2CAA2C,4BAA4B;KACnF,CAAA,EACP,MAAU,QACT,kBAAC,UAAD;KACE,MAAK;KACL,eAAe,EAAS,KAAK;KAC7B,WAAU;eAET,EAAc,GAAG,2CAA2C,QAAQ;KAC9D,CAAA,CAEP;;GAEN,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,GACA,0CACA,iHACD;IACC,CAAA;GAEH,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAa,WAAU,UAAW,CAAA,EACjC,EAAM,QACH;;GAGR,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KAAW,EAAQ,WAAW,IAC7B,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,GAAD,EAAS,WAAU,4BAA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EAAa,WAAU,UAAW,CAAA,EACjC,EACG;;GAEJ"}
@@ -5,7 +5,7 @@ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  function o() {
6
6
  return /* @__PURE__ */ i("div", {
7
7
  className: "flex items-center justify-center min-h-[400px]",
8
- children: /* @__PURE__ */ i(n, { className: "h-8 w-8 animate-spin text-primary" })
8
+ children: /* @__PURE__ */ i(n, { className: "size-8 animate-spin text-primary" })
9
9
  });
10
10
  }
11
11
  var s = class extends e {
@@ -40,7 +40,7 @@ var s = class extends e {
40
40
  children: [
41
41
  /* @__PURE__ */ i("div", {
42
42
  className: "p-3 rounded-full bg-destructive/10",
43
- children: /* @__PURE__ */ i(t, { className: "h-8 w-8 text-destructive" })
43
+ children: /* @__PURE__ */ i(t, { className: "size-8 text-destructive" })
44
44
  }),
45
45
  /* @__PURE__ */ a("div", {
46
46
  className: "space-y-2",
@@ -56,7 +56,7 @@ var s = class extends e {
56
56
  type: "button",
57
57
  onClick: this.handleRetry,
58
58
  className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",
59
- children: [/* @__PURE__ */ i(r, { className: "h-4 w-4" }), "Try Again"]
59
+ children: [/* @__PURE__ */ i(r, { className: "size-4" }), "Try Again"]
60
60
  })
61
61
  ]
62
62
  }) : this.props.children;
@@ -1 +1 @@
1
- {"version":3,"file":"RouteUtils.js","names":[],"sources":["../../../src/sandbox/components/RouteUtils.tsx"],"sourcesContent":["import { Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nexport function PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nexport class LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Sandbox] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n if (this.state.error?.name === 'ChunkLoadError') {\n window.location.reload();\n return;\n }\n this.setState({ hasError: false, error: null });\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-destructive/10\">\n <AlertTriangle className=\"h-8 w-8 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-foreground\">Failed to load page</h3>\n <p className=\"text-sm text-muted-foreground max-w-md\">\n {this.state.error?.message?.includes('Loading chunk')\n ? 'The page chunk could not be loaded. This may be due to a network issue.'\n : 'Something went wrong while loading this page. Please try again.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <RefreshCw className=\"h-4 w-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;;AAMA,SAAgB,IAAa;AAC3B,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,qCAAsC,CAAA;EACrD,CAAA;;AAQV,IAAa,IAAb,cAAuC,EAGrC;CACA,YAAY,GAAgC;AAE1C,EADA,MAAM,EAAM,EACZ,KAAK,QAAQ;GAAE,UAAU;GAAO,OAAO;GAAM;;CAG/C,OAAO,yBAAyB,GAAc;AAC5C,SAAO;GAAE,UAAU;GAAM;GAAO;;CAGlC,kBAAkB,GAAc,GAAsB;AACpD,UAAQ,MAAM,oCAAoC,GAAO,EAAU;;CAGrE,oBAAoB;AAClB,MAAI,KAAK,MAAM,OAAO,SAAS,kBAAkB;AAC/C,UAAO,SAAS,QAAQ;AACxB;;AAEF,OAAK,SAAS;GAAE,UAAU;GAAO,OAAO;GAAM,CAAC;;CAGjD,SAAS;AA2BP,SA1BI,KAAK,MAAM,WAEX,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD,EAAe,WAAU,4BAA6B,CAAA;KAClD,CAAA;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBAAwC;MAAwB,CAAA,EAC9E,kBAAC,KAAD;MAAG,WAAU;gBACV,KAAK,MAAM,OAAO,SAAS,SAAS,gBAAgB,GACjD,4EACA;MACF,CAAA,CACA;;IACN,kBAAC,UAAD;KACE,MAAK;KACL,SAAS,KAAK;KACd,WAAU;eAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,WAAY,CAAA,EAAA,YAE1B;;IACL;OAIH,KAAK,MAAM"}
1
+ {"version":3,"file":"RouteUtils.js","names":[],"sources":["../../../src/sandbox/components/RouteUtils.tsx"],"sourcesContent":["import { Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nexport function PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nexport class LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Sandbox] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n if (this.state.error?.name === 'ChunkLoadError') {\n window.location.reload();\n return;\n }\n this.setState({ hasError: false, error: null });\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-destructive/10\">\n <AlertTriangle className=\"size-8 text-destructive\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-foreground\">Failed to load page</h3>\n <p className=\"text-sm text-muted-foreground max-w-md\">\n {this.state.error?.message?.includes('Loading chunk')\n ? 'The page chunk could not be loaded. This may be due to a network issue.'\n : 'Something went wrong while loading this page. Please try again.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n"],"mappings":";;;;AAMA,SAAgB,IAAa;AAC3B,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,oCAAqC,CAAA;EACpD,CAAA;;AAQV,IAAa,IAAb,cAAuC,EAGrC;CACA,YAAY,GAAgC;AAE1C,EADA,MAAM,EAAM,EACZ,KAAK,QAAQ;GAAE,UAAU;GAAO,OAAO;GAAM;;CAG/C,OAAO,yBAAyB,GAAc;AAC5C,SAAO;GAAE,UAAU;GAAM;GAAO;;CAGlC,kBAAkB,GAAc,GAAsB;AACpD,UAAQ,MAAM,oCAAoC,GAAO,EAAU;;CAGrE,oBAAoB;AAClB,MAAI,KAAK,MAAM,OAAO,SAAS,kBAAkB;AAC/C,UAAO,SAAS,QAAQ;AACxB;;AAEF,OAAK,SAAS;GAAE,UAAU;GAAO,OAAO;GAAM,CAAC;;CAGjD,SAAS;AA2BP,SA1BI,KAAK,MAAM,WAEX,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD,EAAe,WAAU,2BAA4B,CAAA;KACjD,CAAA;IACN,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,MAAD;MAAI,WAAU;gBAAwC;MAAwB,CAAA,EAC9E,kBAAC,KAAD;MAAG,WAAU;gBACV,KAAK,MAAM,OAAO,SAAS,SAAS,gBAAgB,GACjD,4EACA;MACF,CAAA,CACA;;IACN,kBAAC,UAAD;KACE,MAAK;KACL,SAAS,KAAK;KACd,WAAU;eAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA,EAAA,YAEzB;;IACL;OAIH,KAAK,MAAM"}
@@ -56,10 +56,8 @@ function u({ sandboxId: i, workspaceId: u, pageSize: d = 50 }) {
56
56
  className: "text-sm text-text-secondary",
57
57
  children: e(f, "sandbox.activity.empty", "No activity yet.")
58
58
  }) : /* @__PURE__ */ s("ul", {
59
- role: "list",
60
59
  className: "divide-y divide-border-subtle",
61
60
  children: v.map((t) => /* @__PURE__ */ c("li", {
62
- role: "listitem",
63
61
  className: "py-3",
64
62
  children: [/* @__PURE__ */ s("div", {
65
63
  className: "text-sm font-medium text-foreground",
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxActivityTab.js","names":[],"sources":["../../../src/sandbox/components/SandboxActivityTab.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\nconst RECENT_ACTIVITY = gql`\n query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {\n getRecentSandboxActivity(context: $context, limit: $limit) {\n items {\n id\n action\n sandboxName\n sandboxId\n actorId\n status\n createdAt\n }\n total\n }\n }\n`;\n\ninterface ActivityItem {\n id: string;\n action: string;\n sandboxName: string;\n sandboxId?: string | null;\n actorId: string;\n status: string;\n createdAt: string;\n}\n\ninterface Props {\n sandboxId: string;\n workspaceId: string;\n pageSize?: number;\n}\n\n/**\n * Activity / audit feed scoped to a single sandbox. Reuses the existing\n * `getRecentSandboxActivity` admin query and filters client-side by sandboxId\n * so no new backend query is needed for the v0.3.0 cycle. Server-side scoping\n * will move to a dedicated `getSandboxAuditLog(sandboxId)` query in a follow-up.\n */\nexport function SandboxActivityTab({ sandboxId, workspaceId, pageSize = 50 }: Props) {\n const { t } = useI18n();\n const client = useApolloClient();\n const [items, setItems] = useState<ActivityItem[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n client\n .query<{ getRecentSandboxActivity: { items: ActivityItem[] } }>({\n query: RECENT_ACTIVITY,\n variables: { context: { workspaceId }, limit: pageSize },\n fetchPolicy: 'network-only',\n })\n .then((res: { data?: { getRecentSandboxActivity?: { items?: ActivityItem[] } } }) => {\n if (cancelled) return;\n const all: ActivityItem[] = res.data?.getRecentSandboxActivity?.items ?? [];\n setItems(all.filter((entry: ActivityItem) => entry.sandboxId === sandboxId));\n })\n .catch((err: unknown) => {\n if (cancelled) return;\n setError(err instanceof Error ? err.message : String(err));\n });\n return () => {\n cancelled = true;\n };\n }, [client, sandboxId, workspaceId, pageSize]);\n\n const sorted = useMemo(\n () =>\n items\n ?.slice()\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) ?? null,\n [items]\n );\n\n if (error) {\n return (\n <p className=\"text-sm text-status-error-text\">\n {tWithFallback(t, 'sandbox.activity.loadFailed', \"Couldn't load activity.\")}\n </p>\n );\n }\n if (sorted == null) {\n return <p className=\"text-sm text-text-secondary\">…</p>;\n }\n if (sorted.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.empty', 'No activity yet.')}\n </p>\n );\n }\n\n return (\n <ul role=\"list\" className=\"divide-y divide-border-subtle\">\n {sorted.map((entry) => (\n <li key={entry.id} role=\"listitem\" className=\"py-3\">\n <div className=\"text-sm font-medium text-foreground\">{entry.action}</div>\n <div className=\"mt-0.5 text-xs text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.actor', `by ${entry.actorId}`, {\n actor: entry.actorId,\n })}{' '}\n ·{' '}\n {tWithFallback(\n t,\n 'sandbox.activity.atTime',\n `at ${new Date(entry.createdAt).toLocaleString()}`,\n {\n time: new Date(entry.createdAt).toLocaleString(),\n }\n )}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,IAAkB,CAAG;;;;;;;;;;;;;;;;AAuC3B,SAAgB,EAAmB,EAAE,cAAW,gBAAa,cAAW,MAAa;CACnF,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,GAAiB,EAC1B,CAAC,GAAO,KAAY,EAAgC,KAAK,EACzD,CAAC,GAAO,KAAY,EAAwB,KAAK;AAEvD,SAAgB;EACd,IAAI,IAAY;AAgBhB,SAfA,EACG,MAA+D;GAC9D,OAAO;GACP,WAAW;IAAE,SAAS,EAAE,gBAAa;IAAE,OAAO;IAAU;GACxD,aAAa;GACd,CAAC,CACD,MAAM,MAA8E;AAC/E,QAEJ,GAD4B,EAAI,MAAM,0BAA0B,SAAS,EAAE,EAC9D,QAAQ,MAAwB,EAAM,cAAc,EAAU,CAAC;IAC5E,CACD,OAAO,MAAiB;AACnB,QACJ,EAAS,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CAAC;IAC1D,QACS;AACX,OAAY;;IAEb;EAAC;EAAQ;EAAW;EAAa;EAAS,CAAC;CAE9C,IAAM,IAAS,QAEX,GACI,OAAO,CACR,MAAM,GAAG,MAAM,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,MAC1F,CAAC,EAAM,CACR;AAoBD,QAlBI,IAEA,kBAAC,KAAD;EAAG,WAAU;YACV,EAAc,GAAG,+BAA+B,0BAA0B;EACzE,CAAA,GAGJ,KAAU,OACL,kBAAC,KAAD;EAAG,WAAU;YAA8B;EAAK,CAAA,GAErD,EAAO,WAAW,IAElB,kBAAC,KAAD;EAAG,WAAU;YACV,EAAc,GAAG,0BAA0B,mBAAmB;EAC7D,CAAA,GAKN,kBAAC,MAAD;EAAI,MAAK;EAAO,WAAU;YACvB,EAAO,KAAK,MACX,kBAAC,MAAD;GAAmB,MAAK;GAAW,WAAU;aAA7C,CACE,kBAAC,OAAD;IAAK,WAAU;cAAuC,EAAM;IAAa,CAAA,EACzE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,EAAc,GAAG,0BAA0B,MAAM,EAAM,WAAW,EACjE,OAAO,EAAM,SACd,CAAC;KAAE;KAAI;KACN;KACD,EACC,GACA,2BACA,MAAM,IAAI,KAAK,EAAM,UAAU,CAAC,gBAAgB,IAChD,EACE,MAAM,IAAI,KAAK,EAAM,UAAU,CAAC,gBAAgB,EACjD,CACF;KACG;MACH;KAhBI,EAAM,GAgBV,CACL;EACC,CAAA"}
1
+ {"version":3,"file":"SandboxActivityTab.js","names":[],"sources":["../../../src/sandbox/components/SandboxActivityTab.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\nconst RECENT_ACTIVITY = gql`\n query GetRecentSandboxActivity($context: ContextInput!, $limit: Int) {\n getRecentSandboxActivity(context: $context, limit: $limit) {\n items {\n id\n action\n sandboxName\n sandboxId\n actorId\n status\n createdAt\n }\n total\n }\n }\n`;\n\ninterface ActivityItem {\n id: string;\n action: string;\n sandboxName: string;\n sandboxId?: string | null;\n actorId: string;\n status: string;\n createdAt: string;\n}\n\ninterface Props {\n sandboxId: string;\n workspaceId: string;\n pageSize?: number;\n}\n\n/**\n * Activity / audit feed scoped to a single sandbox. Reuses the existing\n * `getRecentSandboxActivity` admin query and filters client-side by sandboxId\n * so no new backend query is needed for the v0.3.0 cycle. Server-side scoping\n * will move to a dedicated `getSandboxAuditLog(sandboxId)` query in a follow-up.\n */\nexport function SandboxActivityTab({ sandboxId, workspaceId, pageSize = 50 }: Props) {\n const { t } = useI18n();\n const client = useApolloClient();\n const [items, setItems] = useState<ActivityItem[] | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n client\n .query<{ getRecentSandboxActivity: { items: ActivityItem[] } }>({\n query: RECENT_ACTIVITY,\n variables: { context: { workspaceId }, limit: pageSize },\n fetchPolicy: 'network-only',\n })\n .then((res: { data?: { getRecentSandboxActivity?: { items?: ActivityItem[] } } }) => {\n if (cancelled) return;\n const all: ActivityItem[] = res.data?.getRecentSandboxActivity?.items ?? [];\n setItems(all.filter((entry: ActivityItem) => entry.sandboxId === sandboxId));\n })\n .catch((err: unknown) => {\n if (cancelled) return;\n setError(err instanceof Error ? err.message : String(err));\n });\n return () => {\n cancelled = true;\n };\n }, [client, sandboxId, workspaceId, pageSize]);\n\n const sorted = useMemo(\n () =>\n items\n ?.slice()\n .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) ?? null,\n [items]\n );\n\n if (error) {\n return (\n <p className=\"text-sm text-status-error-text\">\n {tWithFallback(t, 'sandbox.activity.loadFailed', \"Couldn't load activity.\")}\n </p>\n );\n }\n if (sorted == null) {\n return <p className=\"text-sm text-text-secondary\">…</p>;\n }\n if (sorted.length === 0) {\n return (\n <p className=\"text-sm text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.empty', 'No activity yet.')}\n </p>\n );\n }\n\n return (\n <ul className=\"divide-y divide-border-subtle\">\n {sorted.map((entry) => (\n <li key={entry.id} className=\"py-3\">\n <div className=\"text-sm font-medium text-foreground\">{entry.action}</div>\n <div className=\"mt-0.5 text-xs text-text-secondary\">\n {tWithFallback(t, 'sandbox.activity.actor', `by ${entry.actorId}`, {\n actor: entry.actorId,\n })}{' '}\n ·{' '}\n {tWithFallback(\n t,\n 'sandbox.activity.atTime',\n `at ${new Date(entry.createdAt).toLocaleString()}`,\n {\n time: new Date(entry.createdAt).toLocaleString(),\n }\n )}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;AAMA,IAAM,IAAkB,CAAG;;;;;;;;;;;;;;;;AAuC3B,SAAgB,EAAmB,EAAE,cAAW,gBAAa,cAAW,MAAa;CACnF,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,GAAiB,EAC1B,CAAC,GAAO,KAAY,EAAgC,KAAK,EACzD,CAAC,GAAO,KAAY,EAAwB,KAAK;AAEvD,SAAgB;EACd,IAAI,IAAY;AAgBhB,SAfA,EACG,MAA+D;GAC9D,OAAO;GACP,WAAW;IAAE,SAAS,EAAE,gBAAa;IAAE,OAAO;IAAU;GACxD,aAAa;GACd,CAAC,CACD,MAAM,MAA8E;AAC/E,QAEJ,GAD4B,EAAI,MAAM,0BAA0B,SAAS,EAAE,EAC9D,QAAQ,MAAwB,EAAM,cAAc,EAAU,CAAC;IAC5E,CACD,OAAO,MAAiB;AACnB,QACJ,EAAS,aAAe,QAAQ,EAAI,UAAU,OAAO,EAAI,CAAC;IAC1D,QACS;AACX,OAAY;;IAEb;EAAC;EAAQ;EAAW;EAAa;EAAS,CAAC;CAE9C,IAAM,IAAS,QAEX,GACI,OAAO,CACR,MAAM,GAAG,MAAM,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,MAC1F,CAAC,EAAM,CACR;AAoBD,QAlBI,IAEA,kBAAC,KAAD;EAAG,WAAU;YACV,EAAc,GAAG,+BAA+B,0BAA0B;EACzE,CAAA,GAGJ,KAAU,OACL,kBAAC,KAAD;EAAG,WAAU;YAA8B;EAAK,CAAA,GAErD,EAAO,WAAW,IAElB,kBAAC,KAAD;EAAG,WAAU;YACV,EAAc,GAAG,0BAA0B,mBAAmB;EAC7D,CAAA,GAKN,kBAAC,MAAD;EAAI,WAAU;YACX,EAAO,KAAK,MACX,kBAAC,MAAD;GAAmB,WAAU;aAA7B,CACE,kBAAC,OAAD;IAAK,WAAU;cAAuC,EAAM;IAAa,CAAA,EACzE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,EAAc,GAAG,0BAA0B,MAAM,EAAM,WAAW,EACjE,OAAO,EAAM,SACd,CAAC;KAAE;KAAI;KACN;KACD,EACC,GACA,2BACA,MAAM,IAAI,KAAK,EAAM,UAAU,CAAC,gBAAgB,IAChD,EACE,MAAM,IAAI,KAAK,EAAM,UAAU,CAAC,gBAAgB,EACjD,CACF;KACG;MACH;KAhBI,EAAM,GAgBV,CACL;EACC,CAAA"}
@@ -4,8 +4,7 @@ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region src/sandbox/components/SandboxUsageBanner.tsx
5
5
  function i({ runningCount: i, maxConcurrent: a, minutesConsumed: o, minutesQuota: s }) {
6
6
  let { t: c } = t(), l = a > 0 ? Math.min(100, Math.round(i / a * 100)) : 0;
7
- return /* @__PURE__ */ r("div", {
8
- role: "status",
7
+ return /* @__PURE__ */ r("output", {
9
8
  "aria-live": "polite",
10
9
  className: "flex flex-wrap items-center gap-3 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
11
10
  children: [
@@ -1 +1 @@
1
- {"version":3,"file":"SandboxUsageBanner.js","names":[],"sources":["../../../src/sandbox/components/SandboxUsageBanner.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n /** Concurrent running count from the live list (cheap to compute client-side). */\n runningCount: number;\n /** Workspace policy max (`SandboxConfig.maxConcurrentPerWorkspace`). */\n maxConcurrent: number;\n /** Optional consumed/quota minute counts for monthly usage. Hide block if not provided. */\n minutesConsumed?: number;\n minutesQuota?: number;\n}\n\n/**\n * Compact usage banner shown above the sandbox list. Mirrors the per-workspace\n * limits set by admins so members see why creates are blocked when they hit a cap.\n */\nexport function SandboxUsageBanner({\n runningCount,\n maxConcurrent,\n minutesConsumed,\n minutesQuota,\n}: Props) {\n const { t } = useI18n();\n\n const pct =\n maxConcurrent > 0 ? Math.min(100, Math.round((runningCount / maxConcurrent) * 100)) : 0;\n\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"flex flex-wrap items-center gap-3 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary\"\n >\n <span>\n {tWithFallback(\n t,\n 'sandbox.usageBanner.concurrent',\n `${runningCount} of ${maxConcurrent} sandboxes running`,\n { count: runningCount, max: maxConcurrent }\n )}\n </span>\n <div className=\"h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface\" aria-hidden=\"true\">\n <div\n className={`h-full ${pct >= 90 ? 'bg-status-error-bg-default' : pct >= 70 ? 'bg-status-warning-bg-default' : 'bg-status-success-bg-default'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n {typeof minutesConsumed === 'number' && typeof minutesQuota === 'number' && (\n <span className=\"ml-auto\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.consumed',\n `${minutesConsumed} of ${minutesQuota} minutes used this month`,\n { minutes: minutesConsumed, quota: minutesQuota }\n )}\n </span>\n )}\n </div>\n );\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAmB,EACjC,iBACA,kBACA,oBACA,mBACQ;CACR,IAAM,EAAE,SAAM,GAAS,EAEjB,IACJ,IAAgB,IAAI,KAAK,IAAI,KAAK,KAAK,MAAO,IAAe,IAAiB,IAAI,CAAC,GAAG;AAExF,QACE,kBAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,WAAU;YAHZ;GAKE,kBAAC,QAAD,EAAA,UACG,EACC,GACA,kCACA,GAAG,EAAa,MAAM,EAAc,qBACpC;IAAE,OAAO;IAAc,KAAK;IAAe,CAC5C,EACI,CAAA;GACP,kBAAC,OAAD;IAAK,WAAU;IAAwD,eAAY;cACjF,kBAAC,OAAD;KACE,WAAW,UAAU,KAAO,KAAK,+BAA+B,KAAO,KAAK,iCAAiC;KAC7G,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;KAC3B,CAAA;IACE,CAAA;GACL,OAAO,KAAoB,YAAY,OAAO,KAAiB,YAC9D,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,gCACA,GAAG,EAAgB,MAAM,EAAa,2BACtC;KAAE,SAAS;KAAiB,OAAO;KAAc,CAClD;IACI,CAAA;GAEL"}
1
+ {"version":3,"file":"SandboxUsageBanner.js","names":[],"sources":["../../../src/sandbox/components/SandboxUsageBanner.tsx"],"sourcesContent":["import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n /** Concurrent running count from the live list (cheap to compute client-side). */\n runningCount: number;\n /** Workspace policy max (`SandboxConfig.maxConcurrentPerWorkspace`). */\n maxConcurrent: number;\n /** Optional consumed/quota minute counts for monthly usage. Hide block if not provided. */\n minutesConsumed?: number;\n minutesQuota?: number;\n}\n\n/**\n * Compact usage banner shown above the sandbox list. Mirrors the per-workspace\n * limits set by admins so members see why creates are blocked when they hit a cap.\n */\nexport function SandboxUsageBanner({\n runningCount,\n maxConcurrent,\n minutesConsumed,\n minutesQuota,\n}: Props) {\n const { t } = useI18n();\n\n const pct =\n maxConcurrent > 0 ? Math.min(100, Math.round((runningCount / maxConcurrent) * 100)) : 0;\n\n return (\n <output\n aria-live=\"polite\"\n className=\"flex flex-wrap items-center gap-3 rounded-md border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary\"\n >\n <span>\n {tWithFallback(\n t,\n 'sandbox.usageBanner.concurrent',\n `${runningCount} of ${maxConcurrent} sandboxes running`,\n { count: runningCount, max: maxConcurrent }\n )}\n </span>\n <div className=\"h-1.5 w-32 overflow-hidden rounded-full bg-bg-surface\" aria-hidden=\"true\">\n <div\n className={`h-full ${pct >= 90 ? 'bg-status-error-bg-default' : pct >= 70 ? 'bg-status-warning-bg-default' : 'bg-status-success-bg-default'}`}\n style={{ width: `${pct}%` }}\n />\n </div>\n {typeof minutesConsumed === 'number' && typeof minutesQuota === 'number' && (\n <span className=\"ml-auto\">\n {tWithFallback(\n t,\n 'sandbox.usageBanner.consumed',\n `${minutesConsumed} of ${minutesQuota} minutes used this month`,\n { minutes: minutesConsumed, quota: minutesQuota }\n )}\n </span>\n )}\n </output>\n );\n}\n"],"mappings":";;;;AAiBA,SAAgB,EAAmB,EACjC,iBACA,kBACA,oBACA,mBACQ;CACR,IAAM,EAAE,SAAM,GAAS,EAEjB,IACJ,IAAgB,IAAI,KAAK,IAAI,KAAK,KAAK,MAAO,IAAe,IAAiB,IAAI,CAAC,GAAG;AAExF,QACE,kBAAC,UAAD;EACE,aAAU;EACV,WAAU;YAFZ;GAIE,kBAAC,QAAD,EAAA,UACG,EACC,GACA,kCACA,GAAG,EAAa,MAAM,EAAc,qBACpC;IAAE,OAAO;IAAc,KAAK;IAAe,CAC5C,EACI,CAAA;GACP,kBAAC,OAAD;IAAK,WAAU;IAAwD,eAAY;cACjF,kBAAC,OAAD;KACE,WAAW,UAAU,KAAO,KAAK,+BAA+B,KAAO,KAAK,iCAAiC;KAC7G,OAAO,EAAE,OAAO,GAAG,EAAI,IAAI;KAC3B,CAAA;IACE,CAAA;GACL,OAAO,KAAoB,YAAY,OAAO,KAAiB,YAC9D,kBAAC,QAAD;IAAM,WAAU;cACb,EACC,GACA,gCACA,GAAG,EAAgB,MAAM,EAAa,2BACtC;KAAE,SAAS;KAAiB,OAAO;KAAc,CAClD;IACI,CAAA;GAEF"}
@@ -69,8 +69,7 @@ var p = {
69
69
  EXPIRED: t(s, "sandbox.status.expired", "Expired"),
70
70
  FAILED: t(s, "sandbox.status.failed", "Failed")
71
71
  }[n] ?? c.label;
72
- return /* @__PURE__ */ f("span", {
73
- role: "status",
72
+ return /* @__PURE__ */ f("output", {
74
73
  "aria-label": h,
75
74
  className: e("inline-flex items-center gap-1.5 border rounded-full font-medium", o === "sm" ? "px-2.5 py-0.5 text-xs" : "px-3 py-1 text-sm", c.bg, c.color, r),
76
75
  children: [a && /* @__PURE__ */ d(l, {
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/sandbox/components/StatusBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n Clock,\n Loader2,\n CheckCircle2,\n StopCircle,\n AlertTriangle,\n TimerOff,\n XCircle,\n Circle,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport type { SandboxStatus } from '../types';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface StatusBadgeProps {\n status: SandboxStatus;\n className?: string;\n showIcon?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst statusConfig: Record<\n SandboxStatus,\n { label: string; color: string; bg: string; icon: FC<{ size?: number; className?: string }> }\n> = {\n PENDING: {\n label: 'Pending',\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg-subtle border-border-default',\n icon: Clock,\n },\n PROVISIONING: {\n label: 'Provisioning',\n color: 'text-status-info-text',\n bg: 'bg-status-info-bg-subtle border-border-default',\n icon: Loader2,\n },\n RUNNING: {\n label: 'Running',\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg-subtle border-border-default',\n icon: CheckCircle2,\n },\n STOPPING: {\n label: 'Stopping',\n color: 'text-accent-orange',\n bg: 'bg-accent-orange-subtle border-border-default',\n icon: Loader2,\n },\n STOPPED: {\n label: 'Stopped',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: StopCircle,\n },\n ERROR: {\n label: 'Error',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: AlertTriangle,\n },\n EXPIRED: {\n label: 'Expired',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: TimerOff,\n },\n FAILED: {\n label: 'Failed',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: XCircle,\n },\n};\n\n/**\n * Color-coded status badge for sandbox lifecycle states\n */\nexport const StatusBadge: FC<StatusBadgeProps> = ({\n status,\n className,\n showIcon = true,\n size = 'sm',\n}) => {\n const { t } = useI18n();\n const config = statusConfig[status] || {\n label: status,\n color: 'text-muted-foreground',\n bg: 'bg-muted border-border',\n icon: Circle,\n };\n const Icon = config.icon;\n const isAnimated = status === 'PROVISIONING' || status === 'STOPPING';\n const labels: Record<SandboxStatus, string> = {\n PENDING: tWithFallback(t, 'sandbox.status.pending', 'Pending'),\n PROVISIONING: tWithFallback(t, 'sandbox.status.provisioning', 'Provisioning'),\n RUNNING: tWithFallback(t, 'sandbox.status.running', 'Running'),\n STOPPING: tWithFallback(t, 'sandbox.status.stopping', 'Stopping'),\n STOPPED: tWithFallback(t, 'sandbox.status.stopped', 'Stopped'),\n ERROR: tWithFallback(t, 'sandbox.status.error', 'Error'),\n EXPIRED: tWithFallback(t, 'sandbox.status.expired', 'Expired'),\n FAILED: tWithFallback(t, 'sandbox.status.failed', 'Failed'),\n };\n\n const label = labels[status] ?? config.label;\n return (\n <span\n role=\"status\"\n aria-label={label}\n className={cn(\n 'inline-flex items-center gap-1.5 border rounded-full font-medium',\n size === 'sm' ? 'px-2.5 py-0.5 text-xs' : 'px-3 py-1 text-sm',\n config.bg,\n config.color,\n className\n )}\n >\n {showIcon && (\n <Icon\n size={size === 'sm' ? 12 : 14}\n aria-hidden=\"true\"\n className={cn(isAnimated && 'animate-spin')}\n />\n )}\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;;AAuBA,IAAM,IAGF;CACF,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,cAAc;EACZ,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,UAAU;EACR,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,OAAO;EACL,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,QAAQ;EACN,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACF,EAKY,KAAqC,EAChD,WACA,cACA,cAAW,IACX,UAAO,WACH;CACJ,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,EAAa,MAAW;EACrC,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP,EACK,IAAO,EAAO,MACd,IAAa,MAAW,kBAAkB,MAAW,YAYrD,IAXwC;EAC5C,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,cAAc,EAAc,GAAG,+BAA+B,eAAe;EAC7E,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,UAAU,EAAc,GAAG,2BAA2B,WAAW;EACjE,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,OAAO,EAAc,GAAG,wBAAwB,QAAQ;EACxD,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,QAAQ,EAAc,GAAG,yBAAyB,SAAS;EAC5D,CAEoB,MAAW,EAAO;AACvC,QACE,kBAAC,QAAD;EACE,MAAK;EACL,cAAY;EACZ,WAAW,EACT,oEACA,MAAS,OAAO,0BAA0B,qBAC1C,EAAO,IACP,EAAO,OACP,EACD;YATH,CAWG,KACC,kBAAC,GAAD;GACE,MAAM,MAAS,OAAO,KAAK;GAC3B,eAAY;GACZ,WAAW,EAAG,KAAc,eAAe;GAC3C,CAAA,EAEH,EACI"}
1
+ {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/sandbox/components/StatusBadge.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport {\n Clock,\n Loader2,\n CheckCircle2,\n StopCircle,\n AlertTriangle,\n TimerOff,\n XCircle,\n Circle,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport type { SandboxStatus } from '../types';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface StatusBadgeProps {\n status: SandboxStatus;\n className?: string;\n showIcon?: boolean;\n size?: 'sm' | 'md';\n}\n\nconst statusConfig: Record<\n SandboxStatus,\n { label: string; color: string; bg: string; icon: FC<{ size?: number; className?: string }> }\n> = {\n PENDING: {\n label: 'Pending',\n color: 'text-status-warning-text',\n bg: 'bg-status-warning-bg-subtle border-border-default',\n icon: Clock,\n },\n PROVISIONING: {\n label: 'Provisioning',\n color: 'text-status-info-text',\n bg: 'bg-status-info-bg-subtle border-border-default',\n icon: Loader2,\n },\n RUNNING: {\n label: 'Running',\n color: 'text-status-success-text',\n bg: 'bg-status-success-bg-subtle border-border-default',\n icon: CheckCircle2,\n },\n STOPPING: {\n label: 'Stopping',\n color: 'text-accent-orange',\n bg: 'bg-accent-orange-subtle border-border-default',\n icon: Loader2,\n },\n STOPPED: {\n label: 'Stopped',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: StopCircle,\n },\n ERROR: {\n label: 'Error',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: AlertTriangle,\n },\n EXPIRED: {\n label: 'Expired',\n color: 'text-text-secondary',\n bg: 'bg-bg-sunken border-border-default',\n icon: TimerOff,\n },\n FAILED: {\n label: 'Failed',\n color: 'text-status-error-text',\n bg: 'bg-status-error-bg-subtle border-border-default',\n icon: XCircle,\n },\n};\n\n/**\n * Color-coded status badge for sandbox lifecycle states\n */\nexport const StatusBadge: FC<StatusBadgeProps> = ({\n status,\n className,\n showIcon = true,\n size = 'sm',\n}) => {\n const { t } = useI18n();\n const config = statusConfig[status] || {\n label: status,\n color: 'text-muted-foreground',\n bg: 'bg-muted border-border',\n icon: Circle,\n };\n const Icon = config.icon;\n const isAnimated = status === 'PROVISIONING' || status === 'STOPPING';\n const labels: Record<SandboxStatus, string> = {\n PENDING: tWithFallback(t, 'sandbox.status.pending', 'Pending'),\n PROVISIONING: tWithFallback(t, 'sandbox.status.provisioning', 'Provisioning'),\n RUNNING: tWithFallback(t, 'sandbox.status.running', 'Running'),\n STOPPING: tWithFallback(t, 'sandbox.status.stopping', 'Stopping'),\n STOPPED: tWithFallback(t, 'sandbox.status.stopped', 'Stopped'),\n ERROR: tWithFallback(t, 'sandbox.status.error', 'Error'),\n EXPIRED: tWithFallback(t, 'sandbox.status.expired', 'Expired'),\n FAILED: tWithFallback(t, 'sandbox.status.failed', 'Failed'),\n };\n\n const label = labels[status] ?? config.label;\n return (\n <output\n aria-label={label}\n className={cn(\n 'inline-flex items-center gap-1.5 border rounded-full font-medium',\n size === 'sm' ? 'px-2.5 py-0.5 text-xs' : 'px-3 py-1 text-sm',\n config.bg,\n config.color,\n className\n )}\n >\n {showIcon && (\n <Icon\n size={size === 'sm' ? 12 : 14}\n aria-hidden=\"true\"\n className={cn(isAnimated && 'animate-spin')}\n />\n )}\n {label}\n </output>\n );\n};\n"],"mappings":";;;;;;AAuBA,IAAM,IAGF;CACF,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,cAAc;EACZ,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,UAAU;EACR,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,OAAO;EACL,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,SAAS;EACP,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACD,QAAQ;EACN,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP;CACF,EAKY,KAAqC,EAChD,WACA,cACA,cAAW,IACX,UAAO,WACH;CACJ,IAAM,EAAE,SAAM,GAAS,EACjB,IAAS,EAAa,MAAW;EACrC,OAAO;EACP,OAAO;EACP,IAAI;EACJ,MAAM;EACP,EACK,IAAO,EAAO,MACd,IAAa,MAAW,kBAAkB,MAAW,YAYrD,IAXwC;EAC5C,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,cAAc,EAAc,GAAG,+BAA+B,eAAe;EAC7E,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,UAAU,EAAc,GAAG,2BAA2B,WAAW;EACjE,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,OAAO,EAAc,GAAG,wBAAwB,QAAQ;EACxD,SAAS,EAAc,GAAG,0BAA0B,UAAU;EAC9D,QAAQ,EAAc,GAAG,yBAAyB,SAAS;EAC5D,CAEoB,MAAW,EAAO;AACvC,QACE,kBAAC,UAAD;EACE,cAAY;EACZ,WAAW,EACT,oEACA,MAAS,OAAO,0BAA0B,qBAC1C,EAAO,IACP,EAAO,OACP,EACD;YARH,CAUG,KACC,kBAAC,GAAD;GACE,MAAM,MAAS,OAAO,KAAK;GAC3B,eAAY;GACZ,WAAW,EAAG,KAAc,eAAe;GAC3C,CAAA,EAEH,EACM"}
@@ -11,8 +11,7 @@ function o({ value: o, onChange: s, placeholder: c, maxTags: l = 32, maxLength:
11
11
  }, h = (e) => s(o.filter((t) => t !== e)), g = (e) => {
12
12
  e.key === "Enter" || e.key === "," || e.key === "Tab" ? d.trim() && (e.preventDefault(), m(d), f("")) : e.key === "Backspace" && d === "" && o.length && (e.preventDefault(), h(o[o.length - 1]));
13
13
  }, _ = c ?? e(p, "sandbox.form.tags.placeholder", "Add a tag and press Enter");
14
- return /* @__PURE__ */ a("div", {
15
- role: "group",
14
+ return /* @__PURE__ */ a("fieldset", {
16
15
  "aria-label": e(p, "sandbox.form.tags.label", "Tags"),
17
16
  className: "flex flex-wrap items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5",
18
17
  children: [o.map((t) => /* @__PURE__ */ a("span", {
@@ -36,6 +35,7 @@ function o({ value: o, onChange: s, placeholder: c, maxTags: l = 32, maxLength:
36
35
  d.trim() && (m(d), f(""));
37
36
  },
38
37
  placeholder: o.length ? "" : _,
38
+ "aria-label": e(p, "sandbox.form.tags.input", "Add tag"),
39
39
  className: "flex-1 min-w-[8rem] bg-transparent text-sm text-foreground outline-none placeholder:text-text-tertiary"
40
40
  })]
41
41
  });
@@ -1 +1 @@
1
- {"version":3,"file":"TagsInput.js","names":[],"sources":["../../../src/sandbox/components/TagsInput.tsx"],"sourcesContent":["import { useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n value: string[];\n onChange: (next: string[]) => void;\n placeholder?: string;\n maxTags?: number;\n maxLength?: number;\n}\n\n/**\n * Lightweight chip-style tag input. JSON-array tags (no FK to wspace-tags-svc),\n * matching the backend `tags: String[]` on Sandbox / SandboxTemplate.\n */\nexport function TagsInput({ value, onChange, placeholder, maxTags = 32, maxLength = 64 }: Props) {\n const [draft, setDraft] = useState('');\n const { t } = useI18n();\n\n const addTag = (raw: string) => {\n const tag = raw.trim().slice(0, maxLength);\n if (!tag) return;\n if (value.includes(tag)) return;\n if (value.length >= maxTags) return;\n onChange([...value, tag]);\n };\n\n const removeTag = (tag: string) => onChange(value.filter((t) => t !== tag));\n\n const handleKey = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' || event.key === ',' || event.key === 'Tab') {\n if (draft.trim()) {\n event.preventDefault();\n addTag(draft);\n setDraft('');\n }\n } else if (event.key === 'Backspace' && draft === '' && value.length) {\n event.preventDefault();\n removeTag(value[value.length - 1]);\n }\n };\n\n const ph =\n placeholder ?? tWithFallback(t, 'sandbox.form.tags.placeholder', 'Add a tag and press Enter');\n\n return (\n <div\n role=\"group\"\n aria-label={tWithFallback(t, 'sandbox.form.tags.label', 'Tags')}\n className=\"flex flex-wrap items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5\"\n >\n {value.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\"\n >\n {tag}\n <button\n type=\"button\"\n onClick={() => removeTag(tag)}\n aria-label={tWithFallback(t, 'sandbox.form.tags.remove', `Remove tag ${tag}`, { tag })}\n className=\"text-text-tertiary hover:text-text-secondary\"\n >\n <X size={12} aria-hidden=\"true\" />\n </button>\n </span>\n ))}\n <input\n type=\"text\"\n value={draft}\n onChange={(e) => setDraft(e.target.value.slice(0, maxLength))}\n onKeyDown={handleKey}\n onBlur={() => {\n if (draft.trim()) {\n addTag(draft);\n setDraft('');\n }\n }}\n placeholder={value.length ? '' : ph}\n className=\"flex-1 min-w-[8rem] bg-transparent text-sm text-foreground outline-none placeholder:text-text-tertiary\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,EAAU,EAAE,UAAO,aAAU,gBAAa,aAAU,IAAI,eAAY,MAAa;CAC/F,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,EAAE,SAAM,GAAS,EAEjB,KAAU,MAAgB;EAC9B,IAAM,IAAM,EAAI,MAAM,CAAC,MAAM,GAAG,EAAU;AACrC,QACD,EAAM,SAAS,EAAI,IACnB,EAAM,UAAU,KACpB,EAAS,CAAC,GAAG,GAAO,EAAI,CAAC;IAGrB,KAAa,MAAgB,EAAS,EAAM,QAAQ,MAAM,MAAM,EAAI,CAAC,EAErE,KAAa,MAA2C;AAC5D,EAAI,EAAM,QAAQ,WAAW,EAAM,QAAQ,OAAO,EAAM,QAAQ,QAC1D,EAAM,MAAM,KACd,EAAM,gBAAgB,EACtB,EAAO,EAAM,EACb,EAAS,GAAG,IAEL,EAAM,QAAQ,eAAe,MAAU,MAAM,EAAM,WAC5D,EAAM,gBAAgB,EACtB,EAAU,EAAM,EAAM,SAAS,GAAG;IAIhC,IACJ,KAAe,EAAc,GAAG,iCAAiC,4BAA4B;AAE/F,QACE,kBAAC,OAAD;EACE,MAAK;EACL,cAAY,EAAc,GAAG,2BAA2B,OAAO;EAC/D,WAAU;YAHZ,CAKG,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,WAAU;aAFZ,CAIG,GACD,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAU,EAAI;IAC7B,cAAY,EAAc,GAAG,4BAA4B,cAAc,KAAO,EAAE,QAAK,CAAC;IACtF,WAAU;cAEV,kBAAC,GAAD;KAAG,MAAM;KAAI,eAAY;KAAS,CAAA;IAC3B,CAAA,CACJ;KAZA,EAYA,CACP,EACF,kBAAC,SAAD;GACE,MAAK;GACL,OAAO;GACP,WAAW,MAAM,EAAS,EAAE,OAAO,MAAM,MAAM,GAAG,EAAU,CAAC;GAC7D,WAAW;GACX,cAAc;AACZ,IAAI,EAAM,MAAM,KACd,EAAO,EAAM,EACb,EAAS,GAAG;;GAGhB,aAAa,EAAM,SAAS,KAAK;GACjC,WAAU;GACV,CAAA,CACE"}
1
+ {"version":3,"file":"TagsInput.js","names":[],"sources":["../../../src/sandbox/components/TagsInput.tsx"],"sourcesContent":["import { useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { tWithFallback } from '../utils/i18n';\n\ninterface Props {\n value: string[];\n onChange: (next: string[]) => void;\n placeholder?: string;\n maxTags?: number;\n maxLength?: number;\n}\n\n/**\n * Lightweight chip-style tag input. JSON-array tags (no FK to wspace-tags-svc),\n * matching the backend `tags: String[]` on Sandbox / SandboxTemplate.\n */\nexport function TagsInput({ value, onChange, placeholder, maxTags = 32, maxLength = 64 }: Props) {\n const [draft, setDraft] = useState('');\n const { t } = useI18n();\n\n const addTag = (raw: string) => {\n const tag = raw.trim().slice(0, maxLength);\n if (!tag) return;\n if (value.includes(tag)) return;\n if (value.length >= maxTags) return;\n onChange([...value, tag]);\n };\n\n const removeTag = (tag: string) => onChange(value.filter((t) => t !== tag));\n\n const handleKey = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter' || event.key === ',' || event.key === 'Tab') {\n if (draft.trim()) {\n event.preventDefault();\n addTag(draft);\n setDraft('');\n }\n } else if (event.key === 'Backspace' && draft === '' && value.length) {\n event.preventDefault();\n removeTag(value[value.length - 1]);\n }\n };\n\n const ph =\n placeholder ?? tWithFallback(t, 'sandbox.form.tags.placeholder', 'Add a tag and press Enter');\n\n return (\n <fieldset\n aria-label={tWithFallback(t, 'sandbox.form.tags.label', 'Tags')}\n className=\"flex flex-wrap items-center gap-1.5 rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5\"\n >\n {value.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\"\n >\n {tag}\n <button\n type=\"button\"\n onClick={() => removeTag(tag)}\n aria-label={tWithFallback(t, 'sandbox.form.tags.remove', `Remove tag ${tag}`, { tag })}\n className=\"text-text-tertiary hover:text-text-secondary\"\n >\n <X size={12} aria-hidden=\"true\" />\n </button>\n </span>\n ))}\n <input\n type=\"text\"\n value={draft}\n onChange={(e) => setDraft(e.target.value.slice(0, maxLength))}\n onKeyDown={handleKey}\n onBlur={() => {\n if (draft.trim()) {\n addTag(draft);\n setDraft('');\n }\n }}\n placeholder={value.length ? '' : ph}\n aria-label={tWithFallback(t, 'sandbox.form.tags.input', 'Add tag')}\n className=\"flex-1 min-w-[8rem] bg-transparent text-sm text-foreground outline-none placeholder:text-text-tertiary\"\n />\n </fieldset>\n );\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,EAAU,EAAE,UAAO,aAAU,gBAAa,aAAU,IAAI,eAAY,MAAa;CAC/F,IAAM,CAAC,GAAO,KAAY,EAAS,GAA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