@burdenoff/microfe-proserviceworld 2026.703.1 → 2026.706.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 (79) hide show
  1. package/dist/index.js +2 -3
  2. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  3. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  4. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1716 -0
  5. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  6. package/dist/proserviceworld/ProServiceWorldRoot.js +92 -136
  7. package/dist/proserviceworld/ProServiceWorldRoot.js.map +1 -1
  8. package/dist/proserviceworld/ProServiceWorldRoutes.js +18 -26
  9. package/dist/proserviceworld/ProServiceWorldRoutes.js.map +1 -1
  10. package/dist/proserviceworld/components/DiscussionThread.js +76 -0
  11. package/dist/proserviceworld/components/DiscussionThread.js.map +1 -0
  12. package/dist/proserviceworld/components/ui.js +273 -0
  13. package/dist/proserviceworld/components/ui.js.map +1 -0
  14. package/dist/proserviceworld/hooks/useEntityComments.js +56 -0
  15. package/dist/proserviceworld/hooks/useEntityComments.js.map +1 -0
  16. package/dist/proserviceworld/hooks/useFiles.js +45 -0
  17. package/dist/proserviceworld/hooks/useFiles.js.map +1 -0
  18. package/dist/proserviceworld/hooks/useProServiceWorldApi.js +416 -0
  19. package/dist/proserviceworld/hooks/useProServiceWorldApi.js.map +1 -0
  20. package/dist/proserviceworld/index.js +0 -1
  21. package/dist/proserviceworld/pages/AnalyticsPage.js +163 -475
  22. package/dist/proserviceworld/pages/AnalyticsPage.js.map +1 -1
  23. package/dist/proserviceworld/pages/ClientDetailPage.js +243 -0
  24. package/dist/proserviceworld/pages/ClientDetailPage.js.map +1 -0
  25. package/dist/proserviceworld/pages/ClientsPage.js +295 -0
  26. package/dist/proserviceworld/pages/ClientsPage.js.map +1 -0
  27. package/dist/proserviceworld/pages/CompliancePage.js +307 -0
  28. package/dist/proserviceworld/pages/CompliancePage.js.map +1 -0
  29. package/dist/proserviceworld/pages/ConflictsPage.js +234 -0
  30. package/dist/proserviceworld/pages/ConflictsPage.js.map +1 -0
  31. package/dist/proserviceworld/pages/DashboardPage.js +179 -632
  32. package/dist/proserviceworld/pages/DashboardPage.js.map +1 -1
  33. package/dist/proserviceworld/pages/DocumentsPage.js +235 -539
  34. package/dist/proserviceworld/pages/DocumentsPage.js.map +1 -1
  35. package/dist/proserviceworld/pages/EngagementDetailPage.js +449 -0
  36. package/dist/proserviceworld/pages/EngagementDetailPage.js.map +1 -0
  37. package/dist/proserviceworld/pages/EngagementsPage.js +256 -0
  38. package/dist/proserviceworld/pages/EngagementsPage.js.map +1 -0
  39. package/dist/proserviceworld/pages/InvoicesPage.js +303 -0
  40. package/dist/proserviceworld/pages/InvoicesPage.js.map +1 -0
  41. package/dist/proserviceworld/pages/MattersPage.js +275 -0
  42. package/dist/proserviceworld/pages/MattersPage.js.map +1 -0
  43. package/dist/proserviceworld/pages/PracticeAreasPage.js +176 -0
  44. package/dist/proserviceworld/pages/PracticeAreasPage.js.map +1 -0
  45. package/dist/proserviceworld/pages/TimePage.js +310 -0
  46. package/dist/proserviceworld/pages/TimePage.js.map +1 -0
  47. package/dist/proserviceworld/utils/cn.js +10 -0
  48. package/dist/proserviceworld/utils/cn.js.map +1 -0
  49. package/dist/proserviceworld/utils/nav.js +11 -0
  50. package/dist/proserviceworld/utils/nav.js.map +1 -0
  51. package/package.json +1 -1
  52. package/dist/proserviceworld/pages/AdminReportsPage.js +0 -579
  53. package/dist/proserviceworld/pages/AdminReportsPage.js.map +0 -1
  54. package/dist/proserviceworld/pages/AdminUsersPage.js +0 -468
  55. package/dist/proserviceworld/pages/AdminUsersPage.js.map +0 -1
  56. package/dist/proserviceworld/pages/BookingsPage.js +0 -446
  57. package/dist/proserviceworld/pages/BookingsPage.js.map +0 -1
  58. package/dist/proserviceworld/pages/MessagesPage.js +0 -238
  59. package/dist/proserviceworld/pages/MessagesPage.js.map +0 -1
  60. package/dist/proserviceworld/pages/PaymentsPage.js +0 -537
  61. package/dist/proserviceworld/pages/PaymentsPage.js.map +0 -1
  62. package/dist/proserviceworld/pages/ProjectsPage.js +0 -627
  63. package/dist/proserviceworld/pages/ProjectsPage.js.map +0 -1
  64. package/dist/proserviceworld/pages/ProviderDetailPage.js +0 -538
  65. package/dist/proserviceworld/pages/ProviderDetailPage.js.map +0 -1
  66. package/dist/proserviceworld/pages/ProvidersPage.js +0 -347
  67. package/dist/proserviceworld/pages/ProvidersPage.js.map +0 -1
  68. package/dist/proserviceworld/pages/ReviewsPage.js +0 -356
  69. package/dist/proserviceworld/pages/ReviewsPage.js.map +0 -1
  70. package/dist/proserviceworld/pages/ServiceDetailsPage.js +0 -631
  71. package/dist/proserviceworld/pages/ServiceDetailsPage.js.map +0 -1
  72. package/dist/proserviceworld/pages/ServicesPage.js +0 -344
  73. package/dist/proserviceworld/pages/ServicesPage.js.map +0 -1
  74. package/dist/proserviceworld/pages/VerificationPage.js +0 -370
  75. package/dist/proserviceworld/pages/VerificationPage.js.map +0 -1
  76. package/dist/proserviceworld/store/proserviceworldStore.js +0 -2490
  77. package/dist/proserviceworld/store/proserviceworldStore.js.map +0 -1
  78. package/dist/proserviceworld/utils/i18n.js +0 -15
  79. package/dist/proserviceworld/utils/i18n.js.map +0 -1
@@ -1,563 +1,259 @@
1
- import { useProServiceWorldStore as e } from "../store/proserviceworldStore.js";
2
- import { useMemo as t, useState as n } from "react";
3
- import { ArrowUpDown as r, ChevronRight as i, Clock as ee, Download as a, File as o, FileText as s, FolderOpen as c, FolderPlus as l, Grid3x3 as u, HardDrive as d, Image as f, List as p, MoreHorizontal as m, Search as h, Share2 as g, Star as _, Upload as v, Users as y } from "lucide-react";
4
- import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
5
- import { AuroraBackground as te, Button as C, CTAOverflowMenu as ne, Card as w, CardContent as T, CardHeader as E, CardTitle as D, GlassCard as O, GradientText as re, IllustratedEmptyState as k, Input as A, PagePurpose as j } from "@burdenoff/fe-libs/ui";
1
+ import { useArchiveDocument as e, useCreateDocument as t, useDocuments as n } from "../hooks/useProServiceWorldApi.js";
2
+ import { Banner as r, Empty as i, ErrorState as a, Field as o, LoadingBlock as s, Modal as c, NativeSelect as l, PageHeader as u, SectionCard as d, StatusPill as f, TableWrap as p, Td as m, TextArea as h, TextInput as g, Th as _, enumOptions as v, fmtDate as y, humanize as b } from "../components/ui.js";
3
+ import { getDocumentDownloadUrl as x, uploadDocumentFile as S } from "../hooks/useFiles.js";
4
+ import { useState as C } from "react";
5
+ import { Archive as w, Download as T, FileText as E, Lock as D, Plus as O, Upload as k } from "lucide-react";
6
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
7
+ import { Button as N } from "@burdenoff/fe-libs/ui";
6
8
  //#region src/proserviceworld/pages/DocumentsPage.tsx
7
- var M = {
8
- pdf: s,
9
- docx: o,
10
- doc: o,
11
- txt: s,
12
- image: f,
13
- video: o,
14
- audio: o,
15
- other: o
16
- }, N = {
17
- pdf: "text-status-error-text",
18
- docx: "text-accent-blue",
19
- doc: "text-accent-blue",
20
- txt: "text-text-secondary",
21
- image: "text-status-success-text",
22
- video: "text-accent-purple",
23
- audio: "text-status-warning-text",
24
- other: "text-text-secondary"
25
- }, P = {
26
- blue: "text-accent-blue",
27
- green: "text-status-success-text",
28
- purple: "text-accent-purple",
29
- yellow: "text-status-warning-text",
30
- red: "text-status-error-text"
31
- };
32
- function F(e) {
33
- return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
34
- }
35
- function I() {
36
- let { documents: f, folders: I } = e(), [L, R] = n("grid"), [z, B] = n(""), [V, H] = n("all"), [U, W] = n("date"), [G, K] = n(!1), [q, J] = n(null), [Y, X] = n(!1), [ie, Z] = n(!1), Q = t(() => {
37
- let e = [...f];
38
- if (q && (e = e.filter((e) => e.folderId === q)), V === "starred" ? e = e.filter((e) => e.isStarred) : V !== "all" && (e = e.filter((e) => e.type === V)), z.trim()) {
39
- let t = z.toLowerCase();
40
- e = e.filter((e) => e.name.toLowerCase().includes(t) || e.tags.some((e) => e.toLowerCase().includes(t)));
9
+ var P = [
10
+ "PUBLIC",
11
+ "INTERNAL",
12
+ "CONFIDENTIAL",
13
+ "PRIVILEGED"
14
+ ], F = () => {
15
+ let [t, o] = C(""), [c, h] = C(!1), [g, S] = C(null), { data: k, isLoading: A, error: F, refetch: L } = n({ classification: t || void 0 }), R = e(), z = async (e) => {
16
+ try {
17
+ let t = await x(e);
18
+ window.open(t, "_blank", "noopener");
19
+ } catch (e) {
20
+ S({
21
+ tone: "danger",
22
+ text: e instanceof Error ? e.message : "Could not open document."
23
+ });
41
24
  }
42
- return e.sort((e, t) => {
43
- let n = U === "name" ? e.name.localeCompare(t.name) : U === "date" ? new Date(t.modifiedAt).getTime() - new Date(e.modifiedAt).getTime() : t.size - e.size;
44
- return G ? -n : n;
45
- }), e;
46
- }, [
47
- f,
48
- q,
49
- V,
50
- z,
51
- U,
52
- G
53
- ]), ae = f.reduce((e, t) => e + t.size, 0), oe = f.filter((e) => e.isStarred).length, $ = q ? I.find((e) => e.id === q) : null, se = (e) => {
54
- U === e ? K(!G) : (W(e), K(!1));
55
25
  };
56
- return /* @__PURE__ */ S("div", {
57
- className: "space-y-6 p-6 bg-bg-canvas min-h-screen",
26
+ return /* @__PURE__ */ M("div", {
27
+ className: "space-y-6",
58
28
  children: [
59
- /* @__PURE__ */ S("div", {
60
- className: "relative overflow-hidden rounded-card -mx-2 px-2 pt-1",
61
- children: [/* @__PURE__ */ x(te, { intensity: "subtle" }), /* @__PURE__ */ S("div", {
62
- className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
63
- children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h1", {
64
- className: "text-2xl font-semibold tracking-tight",
65
- children: /* @__PURE__ */ x(re, { children: "Documents" })
66
- }), /* @__PURE__ */ x("p", {
67
- className: "text-sm text-text-secondary",
68
- children: "Manage files, folders, and shared documents."
69
- })] }), /* @__PURE__ */ x(ne, {
70
- primary: {
71
- label: "Upload",
72
- onSelect: () => X(!0),
73
- icon: /* @__PURE__ */ x(v, { className: "h-4 w-4" })
74
- },
75
- actions: [{
76
- label: "New Folder",
77
- onSelect: () => Z(!0),
78
- icon: /* @__PURE__ */ x(l, { className: "h-4 w-4" })
79
- }]
80
- })]
81
- })]
82
- }),
83
- /* @__PURE__ */ x(j, {
84
- icon: /* @__PURE__ */ x(c, { className: "h-4 w-4" }),
85
- children: "A shared home for the files behind your work — contracts, deliverables, briefs, and more. Organise documents into folders, star the ones you reach for often, search across everything, and share files securely with clients and collaborators."
86
- }),
87
- /* @__PURE__ */ S("div", {
88
- className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4",
89
- children: [
90
- /* @__PURE__ */ x(O, {
91
- treatment: "metric",
92
- className: "border-border-seam",
93
- children: /* @__PURE__ */ x(T, {
94
- className: "pt-4",
95
- children: /* @__PURE__ */ S("div", {
96
- className: "flex items-center gap-3",
97
- children: [/* @__PURE__ */ x("div", {
98
- className: "rounded-lg bg-accent-blue-subtle p-2",
99
- children: /* @__PURE__ */ x(s, { className: "h-5 w-5 text-accent-blue" })
100
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
101
- className: "text-2xl font-bold tabular-nums",
102
- children: f.length
103
- }), /* @__PURE__ */ x("p", {
104
- className: "text-xs text-text-secondary",
105
- children: "Total Files"
106
- })] })]
107
- })
108
- })
109
- }),
110
- /* @__PURE__ */ x(O, {
111
- treatment: "metric",
112
- className: "border-border-seam",
113
- children: /* @__PURE__ */ x(T, {
114
- className: "pt-4",
115
- children: /* @__PURE__ */ S("div", {
116
- className: "flex items-center gap-3",
117
- children: [/* @__PURE__ */ x("div", {
118
- className: "rounded-lg bg-accent-purple-subtle p-2",
119
- children: /* @__PURE__ */ x(c, { className: "h-5 w-5 text-accent-purple" })
120
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
121
- className: "text-2xl font-bold tabular-nums",
122
- children: I.length
123
- }), /* @__PURE__ */ x("p", {
124
- className: "text-xs text-text-secondary",
125
- children: "Folders"
126
- })] })]
127
- })
128
- })
129
- }),
130
- /* @__PURE__ */ x(O, {
131
- treatment: "metric",
132
- className: "border-border-seam",
133
- children: /* @__PURE__ */ x(T, {
134
- className: "pt-4",
135
- children: /* @__PURE__ */ S("div", {
136
- className: "flex items-center gap-3",
137
- children: [/* @__PURE__ */ x("div", {
138
- className: "rounded-lg bg-status-warning-bg-subtle p-2",
139
- children: /* @__PURE__ */ x(_, { className: "h-5 w-5 text-status-warning-text" })
140
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
141
- className: "text-2xl font-bold tabular-nums",
142
- children: oe
143
- }), /* @__PURE__ */ x("p", {
144
- className: "text-xs text-text-secondary",
145
- children: "Starred"
146
- })] })]
147
- })
148
- })
149
- }),
150
- /* @__PURE__ */ x(O, {
151
- treatment: "glass",
152
- glow: !0,
153
- className: "border-border-seam",
154
- children: /* @__PURE__ */ x(T, {
155
- className: "pt-4",
156
- children: /* @__PURE__ */ S("div", {
157
- className: "flex items-center gap-3",
158
- children: [/* @__PURE__ */ x("div", {
159
- className: "rounded-lg bg-status-success-bg-subtle p-2",
160
- children: /* @__PURE__ */ x(d, { className: "h-5 w-5 text-status-success-text" })
161
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
162
- className: "text-2xl font-bold tabular-nums",
163
- children: F(ae)
164
- }), /* @__PURE__ */ x("p", {
165
- className: "text-xs text-text-secondary",
166
- children: "Total Size"
167
- })] })]
168
- })
169
- })
170
- })
171
- ]
172
- }),
173
- /* @__PURE__ */ S("div", {
174
- className: "flex items-center gap-2 text-sm",
175
- children: [/* @__PURE__ */ x("button", {
176
- onClick: () => J(null),
177
- className: `font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus rounded ${q ? "text-text-secondary hover:text-text-primary" : "text-accent-blue"}`,
178
- children: "All Files"
179
- }), $ && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(i, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ x("span", {
180
- className: "font-medium text-accent-blue",
181
- children: $.name
182
- })] })]
29
+ /* @__PURE__ */ j(u, {
30
+ title: "Documents",
31
+ subtitle: "Engagement letters, opinions, filings and evidence — metadata, classification and legal hold here; the file itself lives in the shared Files service.",
32
+ icon: /* @__PURE__ */ j(E, { className: "h-6 w-6" }),
33
+ actions: /* @__PURE__ */ M(N, {
34
+ onClick: () => h(!0),
35
+ children: [/* @__PURE__ */ j(O, { className: "mr-1.5 h-4 w-4" }), "Add document"]
36
+ })
183
37
  }),
184
- /* @__PURE__ */ S("div", {
185
- className: "flex flex-col gap-4 sm:flex-row sm:items-center",
186
- children: [/* @__PURE__ */ S("div", {
187
- className: "relative flex-1",
188
- children: [/* @__PURE__ */ x(h, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ x(A, {
189
- placeholder: "Search documents...",
190
- "aria-label": "Search documents",
191
- value: z,
192
- onChange: (e) => B(e.target.value),
193
- className: "pl-10"
194
- })]
195
- }), /* @__PURE__ */ S("div", {
196
- className: "flex flex-wrap items-center gap-2",
197
- children: [/* @__PURE__ */ x("div", {
198
- className: "flex flex-wrap gap-1",
199
- children: [
200
- "all",
201
- "pdf",
202
- "docx",
203
- "txt",
204
- "starred"
205
- ].map((e) => /* @__PURE__ */ x("button", {
206
- onClick: () => H(e),
207
- "aria-pressed": V === e,
208
- className: `rounded px-2 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus ${V === e ? "bg-accent-blue text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"}`,
209
- children: e === "all" ? "All" : e === "starred" ? "Starred" : e.toUpperCase()
210
- }, e))
211
- }), /* @__PURE__ */ S("div", {
212
- className: "flex rounded border border-border-seam",
213
- children: [/* @__PURE__ */ x("button", {
214
- onClick: () => R("grid"),
215
- "aria-label": "Grid view",
216
- "aria-pressed": L === "grid",
217
- className: `p-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus ${L === "grid" ? "bg-accent-blue text-action-primary-text" : "text-text-secondary"}`,
218
- children: /* @__PURE__ */ x(u, { className: "h-4 w-4" })
219
- }), /* @__PURE__ */ x("button", {
220
- onClick: () => R("list"),
221
- "aria-label": "List view",
222
- "aria-pressed": L === "list",
223
- className: `p-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus ${L === "list" ? "bg-accent-blue text-action-primary-text" : "text-text-secondary"}`,
224
- children: /* @__PURE__ */ x(p, { className: "h-4 w-4" })
225
- })]
226
- })]
227
- })]
38
+ g && /* @__PURE__ */ j(r, {
39
+ tone: g.tone,
40
+ onClose: () => S(null),
41
+ children: g.text
228
42
  }),
229
- /* @__PURE__ */ x("div", {
230
- className: "flex gap-2",
231
- children: [
232
- {
233
- field: "name",
234
- label: "Name"
235
- },
236
- {
237
- field: "date",
238
- label: "Date"
239
- },
240
- {
241
- field: "size",
242
- label: "Size"
243
- }
244
- ].map(({ field: e, label: t }) => /* @__PURE__ */ S("button", {
245
- onClick: () => se(e),
246
- "aria-pressed": U === e,
247
- className: `flex items-center gap-1 rounded border px-3 py-1 text-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus ${U === e ? "border-accent-blue bg-accent-blue-subtle text-accent-blue" : "border-border-seam text-text-secondary hover:text-text-primary"}`,
248
- children: [/* @__PURE__ */ x(r, { className: "h-3 w-3" }), t]
249
- }, e))
43
+ /* @__PURE__ */ j("div", {
44
+ className: "flex justify-end",
45
+ children: /* @__PURE__ */ M(l, {
46
+ value: t,
47
+ onChange: (e) => o(e.target.value),
48
+ className: "sm:w-52",
49
+ children: [/* @__PURE__ */ j("option", {
50
+ value: "",
51
+ children: "All classifications"
52
+ }), v(P)]
53
+ })
250
54
  }),
251
- !q && /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h3", {
252
- className: "mb-3 text-sm font-medium text-text-secondary",
253
- children: "Folders"
254
- }), /* @__PURE__ */ x("div", {
255
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
256
- children: I.map((e) => /* @__PURE__ */ S("button", {
257
- onClick: () => J(e.id),
258
- className: "flex items-center gap-3 rounded-lg border border-border-seam p-3 text-left transition-shadow hover:shadow-pop focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
259
- children: [/* @__PURE__ */ x(c, { className: `h-8 w-8 ${P[e.color] ?? "text-text-secondary"}` }), /* @__PURE__ */ S("div", {
260
- className: "min-w-0 flex-1",
261
- children: [/* @__PURE__ */ x("p", {
262
- className: "truncate font-medium text-sm",
263
- children: e.name
264
- }), /* @__PURE__ */ S("p", {
265
- className: "text-xs text-text-secondary",
55
+ A ? /* @__PURE__ */ j(s, {}) : F ? /* @__PURE__ */ j(a, {
56
+ error: F,
57
+ onRetry: () => void L()
58
+ }) : !k || k.items.length === 0 ? /* @__PURE__ */ j(i, {
59
+ title: "No documents",
60
+ description: "Add a document — upload the file to the shared Files service and record it here.",
61
+ icon: /* @__PURE__ */ j(E, { className: "h-8 w-8" }),
62
+ action: /* @__PURE__ */ M(N, {
63
+ onClick: () => h(!0),
64
+ children: [/* @__PURE__ */ j(O, { className: "mr-1.5 h-4 w-4" }), "Add document"]
65
+ })
66
+ }) : /* @__PURE__ */ j(d, {
67
+ title: `${k.totalCount} document${k.totalCount === 1 ? "" : "s"}`,
68
+ children: /* @__PURE__ */ M(p, { children: [/* @__PURE__ */ j("thead", { children: /* @__PURE__ */ M("tr", { children: [
69
+ /* @__PURE__ */ j(_, { children: "Name" }),
70
+ /* @__PURE__ */ j(_, { children: "Classification" }),
71
+ /* @__PURE__ */ j(_, { children: "Status" }),
72
+ /* @__PURE__ */ j(_, { children: "Added" }),
73
+ /* @__PURE__ */ j(_, {
74
+ className: "text-right",
75
+ children: "Actions"
76
+ })
77
+ ] }) }), /* @__PURE__ */ j("tbody", { children: k.items.map((e) => /* @__PURE__ */ M("tr", {
78
+ className: "hover:bg-bg-sunken/50",
79
+ children: [
80
+ /* @__PURE__ */ j(m, { children: /* @__PURE__ */ M("span", {
81
+ className: "flex items-center gap-1.5 font-medium text-text-primary",
266
82
  children: [
267
- /* @__PURE__ */ x("span", {
268
- className: "tabular-nums",
269
- children: e.documentsCount
83
+ e.legalHold && /* @__PURE__ */ j(D, {
84
+ className: "h-3.5 w-3.5 text-status-warning-text",
85
+ "aria-label": "Legal hold"
270
86
  }),
271
- " files",
272
- e.isPublic && " - Public"
273
- ]
274
- })]
275
- })]
276
- }, e.id))
277
- })] }),
278
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("h3", {
279
- className: "mb-3 text-sm font-medium text-text-secondary",
280
- children: ["Files ", Q.length > 0 && `(${Q.length})`]
281
- }), Q.length === 0 ? /* @__PURE__ */ x(w, {
282
- className: "border-border-seam",
283
- children: /* @__PURE__ */ x(T, {
284
- className: "py-6",
285
- children: /* @__PURE__ */ x(k, {
286
- illustration: z || V !== "all" ? "empty-search" : "empty-files",
287
- title: "No files found",
288
- description: "Try adjusting your filters or upload a new document.",
289
- action: /* @__PURE__ */ S(C, {
290
- size: "sm",
291
- onClick: () => X(!0),
292
- children: [/* @__PURE__ */ x(v, { className: "mr-2 h-4 w-4" }), " Upload"]
293
- })
294
- })
295
- })
296
- }) : L === "grid" ? /* @__PURE__ */ x("div", {
297
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
298
- children: Q.map((e) => /* @__PURE__ */ x(O, {
299
- treatment: "plain",
300
- className: "border-border-seam transition-shadow hover:shadow-pop",
301
- children: /* @__PURE__ */ S(T, {
302
- className: "pt-4",
303
- children: [
304
- /* @__PURE__ */ S("div", {
305
- className: "flex items-start justify-between",
306
- children: [/* @__PURE__ */ x(M[e.type] ?? o, { className: `h-10 w-10 ${N[e.type] ?? "text-text-secondary"}` }), /* @__PURE__ */ S("div", {
307
- className: "flex items-center gap-1",
308
- children: [e.isStarred && /* @__PURE__ */ x(_, { className: "h-4 w-4 fill-status-warning-text text-status-warning-text" }), e.sharedWith > 0 && /* @__PURE__ */ x(g, { className: "h-4 w-4 text-text-secondary" })]
309
- })]
310
- }),
311
- /* @__PURE__ */ x("h4", {
312
- className: "mt-3 truncate font-medium text-sm",
313
- children: e.name
314
- }),
315
- /* @__PURE__ */ S("div", {
316
- className: "mt-1 flex items-center gap-2 text-xs text-text-secondary",
317
- children: [/* @__PURE__ */ x("span", {
318
- className: "tabular-nums",
319
- children: F(e.size)
320
- }), /* @__PURE__ */ S("span", {
321
- className: "tabular-nums",
87
+ e.name,
88
+ " ",
89
+ /* @__PURE__ */ M("span", {
90
+ className: "text-xs text-text-tertiary",
322
91
  children: ["v", e.version]
323
- })]
324
- }),
325
- /* @__PURE__ */ S("div", {
326
- className: "mt-2 flex items-center gap-1 text-xs text-text-secondary",
327
- children: [
328
- /* @__PURE__ */ x(ee, { className: "h-3 w-3" }),
329
- " ",
330
- e.modifiedAt
331
- ]
332
- }),
333
- /* @__PURE__ */ S("div", {
334
- className: "mt-3 flex gap-1",
335
- children: [/* @__PURE__ */ S(C, {
336
- variant: "outline",
92
+ })
93
+ ]
94
+ }) }),
95
+ /* @__PURE__ */ j(m, { children: b(e.classification) }),
96
+ /* @__PURE__ */ j(m, { children: /* @__PURE__ */ j(f, { status: e.status }) }),
97
+ /* @__PURE__ */ j(m, { children: y(e.createdAt) }),
98
+ /* @__PURE__ */ j(m, {
99
+ className: "text-right",
100
+ children: /* @__PURE__ */ M("div", {
101
+ className: "flex justify-end gap-1",
102
+ children: [e.file?.id && /* @__PURE__ */ j(N, {
103
+ variant: "ghost",
337
104
  size: "sm",
338
- className: "flex-1 text-xs",
339
- children: [/* @__PURE__ */ x(a, { className: "mr-1 h-3 w-3" }), " Download"]
340
- }), /* @__PURE__ */ x(C, {
341
- variant: "outline",
105
+ onClick: () => void z(e.file.id),
106
+ "aria-label": "Download",
107
+ children: /* @__PURE__ */ j(T, { className: "h-4 w-4" })
108
+ }), e.status !== "ARCHIVED" && /* @__PURE__ */ j(N, {
109
+ variant: "ghost",
342
110
  size: "sm",
343
- "aria-label": "More actions",
344
- children: /* @__PURE__ */ x(m, { className: "h-3 w-3" })
345
- })]
346
- })
347
- ]
348
- })
349
- }, e.id))
350
- }) : /* @__PURE__ */ x(w, {
351
- className: "border-border-seam",
352
- children: /* @__PURE__ */ x(T, {
353
- className: "pt-4",
354
- children: /* @__PURE__ */ x("div", {
355
- className: "overflow-x-auto",
356
- children: /* @__PURE__ */ S("table", {
357
- className: "w-full text-sm",
358
- children: [/* @__PURE__ */ x("thead", { children: /* @__PURE__ */ S("tr", {
359
- className: "border-b border-border-seam text-left text-text-secondary",
360
- children: [
361
- /* @__PURE__ */ x("th", {
362
- className: "p-3",
363
- children: "Name"
364
- }),
365
- /* @__PURE__ */ x("th", {
366
- className: "p-3",
367
- children: "Type"
368
- }),
369
- /* @__PURE__ */ x("th", {
370
- className: "p-3",
371
- children: "Size"
372
- }),
373
- /* @__PURE__ */ x("th", {
374
- className: "p-3",
375
- children: "Modified"
376
- }),
377
- /* @__PURE__ */ x("th", {
378
- className: "p-3",
379
- children: "Uploaded By"
380
- }),
381
- /* @__PURE__ */ x("th", {
382
- className: "p-3 text-right",
383
- children: "Actions"
384
- })
385
- ]
386
- }) }), /* @__PURE__ */ x("tbody", { children: Q.map((e) => /* @__PURE__ */ S("tr", {
387
- className: "border-b border-border-seam hover:bg-bg-sunken",
388
- children: [
389
- /* @__PURE__ */ x("td", {
390
- className: "p-3",
391
- children: /* @__PURE__ */ S("div", {
392
- className: "flex items-center gap-2",
393
- children: [
394
- /* @__PURE__ */ x(M[e.type] ?? o, { className: `h-5 w-5 ${N[e.type] ?? "text-text-secondary"}` }),
395
- /* @__PURE__ */ x("span", {
396
- className: "font-medium",
397
- children: e.name
398
- }),
399
- e.isStarred && /* @__PURE__ */ x(_, { className: "h-3 w-3 fill-status-warning-text text-status-warning-text" }),
400
- e.sharedWith > 0 && /* @__PURE__ */ S("span", {
401
- className: "flex items-center gap-0.5 text-xs text-text-secondary",
402
- children: [
403
- /* @__PURE__ */ x(y, { className: "h-3 w-3" }),
404
- " ",
405
- /* @__PURE__ */ x("span", {
406
- className: "tabular-nums",
407
- children: e.sharedWith
408
- })
409
- ]
410
- })
411
- ]
111
+ "aria-label": "Archive",
112
+ disabled: R.isPending,
113
+ onClick: () => R.mutate(e.id, {
114
+ onSuccess: () => S({
115
+ tone: "success",
116
+ text: `${e.name} archived.`
117
+ }),
118
+ onError: (e) => S({
119
+ tone: "danger",
120
+ text: e instanceof Error ? e.message : "Failed."
412
121
  })
413
122
  }),
414
- /* @__PURE__ */ x("td", {
415
- className: "p-3 uppercase text-xs",
416
- children: e.type
417
- }),
418
- /* @__PURE__ */ x("td", {
419
- className: "p-3 tabular-nums",
420
- children: F(e.size)
421
- }),
422
- /* @__PURE__ */ x("td", {
423
- className: "p-3 text-text-secondary",
424
- children: e.modifiedAt
425
- }),
426
- /* @__PURE__ */ x("td", {
427
- className: "p-3 text-text-secondary",
428
- children: e.uploadedBy
429
- }),
430
- /* @__PURE__ */ x("td", {
431
- className: "p-3",
432
- children: /* @__PURE__ */ S("div", {
433
- className: "flex justify-end gap-1",
434
- children: [/* @__PURE__ */ x(C, {
435
- variant: "outline",
436
- size: "sm",
437
- "aria-label": "Download",
438
- children: /* @__PURE__ */ x(a, { className: "h-3 w-3" })
439
- }), /* @__PURE__ */ x(C, {
440
- variant: "outline",
441
- size: "sm",
442
- "aria-label": "Share",
443
- children: /* @__PURE__ */ x(g, { className: "h-3 w-3" })
444
- })]
445
- })
446
- })
447
- ]
448
- }, e.id)) })]
123
+ children: /* @__PURE__ */ j(w, { className: "h-4 w-4" })
124
+ })]
125
+ })
449
126
  })
127
+ ]
128
+ }, e.id)) })] })
129
+ }),
130
+ c && /* @__PURE__ */ j(I, {
131
+ onClose: () => h(!1),
132
+ onDone: () => {
133
+ L(), S({
134
+ tone: "success",
135
+ text: "Document added."
136
+ });
137
+ }
138
+ })
139
+ ]
140
+ });
141
+ }, I = ({ onClose: e, onDone: n }) => {
142
+ let i = t(), [a, s] = C({
143
+ name: "",
144
+ classification: "INTERNAL",
145
+ description: "",
146
+ legalHold: !1
147
+ }), [u, d] = C(null), [f, p] = C(!1), [m, _] = C(null), y = async () => {
148
+ if (_(null), !a.name.trim()) return _("Document name is required.");
149
+ let t = null;
150
+ if (u) {
151
+ try {
152
+ p(!0), t = (await S(u)).fileId;
153
+ } catch (e) {
154
+ return p(!1), _(e instanceof Error ? e.message : "Upload failed.");
155
+ }
156
+ p(!1);
157
+ }
158
+ i.mutate({
159
+ name: a.name.trim(),
160
+ classification: a.classification,
161
+ description: a.description.trim() || null,
162
+ legalHold: a.legalHold,
163
+ fileId: t
164
+ }, {
165
+ onSuccess: () => {
166
+ n(), e();
167
+ },
168
+ onError: (e) => _(e instanceof Error ? e.message : "Failed.")
169
+ });
170
+ }, b = f || i.isPending;
171
+ return /* @__PURE__ */ j(c, {
172
+ open: !0,
173
+ onClose: e,
174
+ title: "Add document",
175
+ footer: /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(N, {
176
+ variant: "outline",
177
+ onClick: e,
178
+ disabled: b,
179
+ children: "Cancel"
180
+ }), /* @__PURE__ */ j(N, {
181
+ onClick: () => void y(),
182
+ disabled: b,
183
+ children: f ? "Uploading…" : i.isPending ? "Saving…" : "Add document"
184
+ })] }),
185
+ children: /* @__PURE__ */ M("div", {
186
+ className: "space-y-3",
187
+ children: [
188
+ m && /* @__PURE__ */ j(r, {
189
+ tone: "danger",
190
+ children: m
191
+ }),
192
+ /* @__PURE__ */ j(o, {
193
+ label: "Name",
194
+ required: !0,
195
+ children: /* @__PURE__ */ j(g, {
196
+ value: a.name,
197
+ onChange: (e) => s((t) => ({
198
+ ...t,
199
+ name: e.target.value
200
+ })),
201
+ placeholder: "Engagement letter — Acme FY26"
450
202
  })
451
- })
452
- })] }),
453
- Y && /* @__PURE__ */ x("div", {
454
- className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay",
455
- children: /* @__PURE__ */ S(O, {
456
- treatment: "glass",
457
- className: "mx-4 w-full max-w-md border-border-seam",
458
- children: [/* @__PURE__ */ x(E, { children: /* @__PURE__ */ S("div", {
459
- className: "flex items-center justify-between",
460
- children: [/* @__PURE__ */ x(D, { children: "Upload Files" }), /* @__PURE__ */ x(C, {
461
- variant: "outline",
462
- size: "sm",
463
- onClick: () => X(!1),
464
- children: "Close"
465
- })]
466
- }) }), /* @__PURE__ */ S(T, {
467
- className: "space-y-4",
203
+ }),
204
+ /* @__PURE__ */ j(o, {
205
+ label: "Classification",
206
+ children: /* @__PURE__ */ j(l, {
207
+ value: a.classification,
208
+ onChange: (e) => s((t) => ({
209
+ ...t,
210
+ classification: e.target.value
211
+ })),
212
+ children: v(P)
213
+ })
214
+ }),
215
+ /* @__PURE__ */ j(o, {
216
+ label: "File",
217
+ hint: "Optional — stored in the shared Files service.",
218
+ children: /* @__PURE__ */ M("label", {
219
+ className: "flex cursor-pointer items-center gap-2 rounded-lg border border-dashed border-border-seam bg-bg-canvas px-3 py-3 text-sm text-text-secondary hover:border-accent",
468
220
  children: [
469
- /* @__PURE__ */ S("div", {
470
- className: "flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-border-seam p-8",
471
- children: [
472
- /* @__PURE__ */ x(v, { className: "h-10 w-10 text-text-secondary" }),
473
- /* @__PURE__ */ x("p", {
474
- className: "mt-2 text-sm font-medium",
475
- children: "Drag & drop files here"
476
- }),
477
- /* @__PURE__ */ x("p", {
478
- className: "text-xs text-text-secondary",
479
- children: "or click to browse"
480
- })
481
- ]
482
- }),
483
- /* @__PURE__ */ S("div", {
484
- className: "space-y-2",
485
- children: [/* @__PURE__ */ x("label", {
486
- className: "text-sm font-medium",
487
- htmlFor: "upload-folder",
488
- children: "Destination Folder"
489
- }), /* @__PURE__ */ S("select", {
490
- id: "upload-folder",
491
- className: "w-full rounded border border-border-seam bg-bg-surface px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
492
- children: [/* @__PURE__ */ x("option", {
493
- value: "",
494
- children: "Root"
495
- }), I.map((e) => /* @__PURE__ */ x("option", {
496
- value: e.id,
497
- children: e.name
498
- }, e.id))]
499
- })]
500
- }),
501
- /* @__PURE__ */ S("div", {
502
- className: "flex gap-2",
503
- children: [/* @__PURE__ */ x(C, {
504
- variant: "outline",
505
- className: "flex-1",
506
- onClick: () => X(!1),
507
- children: "Cancel"
508
- }), /* @__PURE__ */ x(C, {
509
- className: "flex-1",
510
- children: "Upload"
511
- })]
221
+ /* @__PURE__ */ j(k, { className: "h-4 w-4 text-text-tertiary" }),
222
+ u ? u.name : "Choose a file…",
223
+ /* @__PURE__ */ j("input", {
224
+ type: "file",
225
+ className: "hidden",
226
+ onChange: (e) => d(e.target.files?.[0] ?? null)
512
227
  })
513
228
  ]
514
- })]
515
- })
516
- }),
517
- ie && /* @__PURE__ */ x("div", {
518
- className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay",
519
- children: /* @__PURE__ */ S(O, {
520
- treatment: "glass",
521
- className: "mx-4 w-full max-w-md border-border-seam",
522
- children: [/* @__PURE__ */ x(E, { children: /* @__PURE__ */ S("div", {
523
- className: "flex items-center justify-between",
524
- children: [/* @__PURE__ */ x(D, { children: "Create Folder" }), /* @__PURE__ */ x(C, {
525
- variant: "outline",
526
- size: "sm",
527
- onClick: () => Z(!1),
528
- children: "Close"
529
- })]
530
- }) }), /* @__PURE__ */ S(T, {
531
- className: "space-y-4",
532
- children: [/* @__PURE__ */ S("div", {
533
- className: "space-y-2",
534
- children: [/* @__PURE__ */ x("label", {
535
- className: "text-sm font-medium",
536
- htmlFor: "folder-name",
537
- children: "Folder Name"
538
- }), /* @__PURE__ */ x(A, {
539
- id: "folder-name",
540
- placeholder: "Enter folder name..."
541
- })]
542
- }), /* @__PURE__ */ S("div", {
543
- className: "flex gap-2",
544
- children: [/* @__PURE__ */ x(C, {
545
- variant: "outline",
546
- className: "flex-1",
547
- onClick: () => Z(!1),
548
- children: "Cancel"
549
- }), /* @__PURE__ */ x(C, {
550
- className: "flex-1",
551
- children: "Create"
552
- })]
553
- })]
554
- })]
229
+ })
230
+ }),
231
+ /* @__PURE__ */ j(o, {
232
+ label: "Description",
233
+ children: /* @__PURE__ */ j(h, {
234
+ value: a.description,
235
+ onChange: (e) => s((t) => ({
236
+ ...t,
237
+ description: e.target.value
238
+ }))
239
+ })
240
+ }),
241
+ /* @__PURE__ */ M("label", {
242
+ className: "flex items-center gap-2 text-sm text-text-secondary",
243
+ children: [/* @__PURE__ */ j("input", {
244
+ type: "checkbox",
245
+ checked: a.legalHold,
246
+ onChange: (e) => s((t) => ({
247
+ ...t,
248
+ legalHold: e.target.checked
249
+ }))
250
+ }), "Place under legal hold (cannot be disposed)"]
555
251
  })
556
- })
557
- ]
252
+ ]
253
+ })
558
254
  });
559
- }
255
+ };
560
256
  //#endregion
561
- export { I as DocumentsPage };
257
+ export { F as DocumentsPage };
562
258
 
563
259
  //# sourceMappingURL=DocumentsPage.js.map