@burdenoff/microfe-govcitizenhub 2026.705.1 → 2026.705.3

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 (69) hide show
  1. package/dist/govcitizenhub/components/Avatar.js +55 -0
  2. package/dist/govcitizenhub/components/Avatar.js.map +1 -0
  3. package/dist/govcitizenhub/components/DocumentUploadField.js +95 -45
  4. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  5. package/dist/govcitizenhub/components/FilterTabs.js +5 -4
  6. package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
  7. package/dist/govcitizenhub/components/KeyValueList.js +23 -0
  8. package/dist/govcitizenhub/components/KeyValueList.js.map +1 -0
  9. package/dist/govcitizenhub/components/MetricsCard.js +51 -26
  10. package/dist/govcitizenhub/components/MetricsCard.js.map +1 -1
  11. package/dist/govcitizenhub/components/PageLayout.js +81 -51
  12. package/dist/govcitizenhub/components/PageLayout.js.map +1 -1
  13. package/dist/govcitizenhub/components/Pagination.js +41 -19
  14. package/dist/govcitizenhub/components/Pagination.js.map +1 -1
  15. package/dist/govcitizenhub/components/SectionCard.js +31 -0
  16. package/dist/govcitizenhub/components/SectionCard.js.map +1 -0
  17. package/dist/govcitizenhub/components/SlaBadge.js +71 -0
  18. package/dist/govcitizenhub/components/SlaBadge.js.map +1 -0
  19. package/dist/govcitizenhub/components/StateViews.js +1 -16
  20. package/dist/govcitizenhub/components/StateViews.js.map +1 -1
  21. package/dist/govcitizenhub/components/StatusBadge.js +23 -10
  22. package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
  23. package/dist/govcitizenhub/components/StatusStepper.js +55 -0
  24. package/dist/govcitizenhub/components/StatusStepper.js.map +1 -0
  25. package/dist/govcitizenhub/components/SummaryStrip.js +54 -0
  26. package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -0
  27. package/dist/govcitizenhub/components/TagInput.js +2 -2
  28. package/dist/govcitizenhub/components/TagInput.js.map +1 -1
  29. package/dist/govcitizenhub/components/Timeline.js +61 -0
  30. package/dist/govcitizenhub/components/Timeline.js.map +1 -0
  31. package/dist/govcitizenhub/hooks/useFiles.js +50 -22
  32. package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
  33. package/dist/govcitizenhub/hooks/useGovApi.js +44 -34
  34. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  35. package/dist/govcitizenhub/pages/DashboardPage.js +118 -50
  36. package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
  37. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +258 -137
  38. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  39. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +103 -90
  40. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
  41. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +493 -397
  42. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  43. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +268 -80
  44. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  45. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +412 -174
  46. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  47. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +313 -115
  48. package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
  49. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +379 -176
  50. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  51. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +275 -184
  52. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  53. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +251 -133
  54. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  55. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +175 -105
  56. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  57. package/dist/govcitizenhub/pages/permits/PermitsPage.js +204 -110
  58. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  59. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +290 -113
  60. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
  61. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +301 -0
  62. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -0
  63. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +248 -163
  64. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
  65. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +182 -148
  66. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  67. package/dist/govcitizenhub/pages/services/ServicesPage.js +228 -137
  68. package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
  69. package/package.json +1 -1
@@ -1,30 +1,34 @@
1
1
  import { useGovCitizenHub as e } from "../../context/GovCitizenHubContext.js";
2
- import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { formatCurrency as n } from "../../utils/formatters.js";
4
- import { StatusBadge as r } from "../../components/StatusBadge.js";
5
- import { EmptyState as i } from "../../components/EmptyState.js";
2
+ import { cn as t } from "../../utils/cn.js";
3
+ import { PageLayout as n } from "../../components/PageLayout.js";
4
+ import { formatCurrency as r } from "../../utils/formatters.js";
5
+ import { StatusBadge as i } from "../../components/StatusBadge.js";
6
+ import { EmptyState as a } from "../../components/EmptyState.js";
6
7
  import "../../context/index.js";
7
- import { useGovCreateApplication as a, useGovService as o, useGovServices as s, useGovSubmitApplication as c } from "../../hooks/useGovApi.js";
8
+ import { useGovCreateApplication as o, useGovService as s, useGovServices as ee, useGovSubmitApplication as te } from "../../hooks/useGovApi.js";
9
+ import { FILE_FOLDERS as ne, uploadFileToFiles as re } from "../../hooks/useFiles.js";
8
10
  import "../../hooks/index.js";
9
- import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
10
- import { describeError as d, notify as f } from "../../lib/toast.js";
11
- import { useMemo as p, useState as m } from "react";
12
- import { ChevronRight as h, Save as g, Send as _ } from "lucide-react";
13
- import { useSearchParams as v } from "react-router-dom";
14
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
15
- import { Button as x, GlassCard as ee, Input as S, Label as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
11
+ import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js";
12
+ import { describeError as u, notify as d } from "../../lib/toast.js";
13
+ import { StatusStepper as ie } from "../../components/StatusStepper.js";
14
+ import { KeyValueList as f } from "../../components/KeyValueList.js";
15
+ import { useMemo as ae, useState as p } from "react";
16
+ import { CheckCircle2 as m, ChevronLeft as oe, ChevronRight as h, Clock as g, FileText as _, Loader2 as v, Save as y, Send as se, UploadCloud as b } from "lucide-react";
17
+ import { useSearchParams as ce } from "react-router-dom";
18
+ import { Fragment as le, jsx as x, jsxs as S } from "react/jsx-runtime";
19
+ import { Button as C, GlassCard as w, Input as T, Label as E, Select as D, SelectContent as O, SelectItem as k, SelectTrigger as A, SelectValue as j, Textarea as M } from "@burdenoff/fe-libs/ui";
16
20
  //#region src/govcitizenhub/pages/applications/NewApplicationPage.tsx
17
- var A = [
21
+ var ue = [
18
22
  "LOW",
19
23
  "NORMAL",
20
24
  "HIGH",
21
25
  "URGENT"
22
26
  ];
23
- function te(e) {
27
+ function de(e) {
24
28
  let t = (e, t) => {
25
29
  if (!e || typeof e != "object") return null;
26
30
  let n = e, r = String(n.key ?? n.name ?? n.id ?? t), i = String(n.label ?? n.title ?? r), a = String(n.type ?? "text").toLowerCase(), o = Array.isArray(n.options) ? n.options.map((e) => String(e)) : Array.isArray(n.enum) ? n.enum.map((e) => String(e)) : void 0, s = "text";
27
- return o && o.length ? s = "select" : a.includes("area") || a === "textarea" || a === "multiline" ? s = "textarea" : (a === "number" || a === "integer" || a === "float") && (s = "number"), {
31
+ return o && o.length ? s = "select" : a.includes("area") || a === "textarea" || a === "multiline" ? s = "textarea" : a === "number" || a === "integer" || a === "float" ? s = "number" : a === "date" || a === "datetime" ? s = "date" : (a === "file" || a === "upload") && (s = "file"), {
28
32
  key: r,
29
33
  label: i,
30
34
  type: s,
@@ -43,208 +47,442 @@ function te(e) {
43
47
  }
44
48
  return [];
45
49
  }
46
- function j() {
47
- let { navigateTo: j } = e(), [M] = v(), N = M.get("serviceId") ?? void 0, [P, ne] = m(N), F = P ?? N, I = s({
50
+ var N = [
51
+ "choose",
52
+ "fill",
53
+ "review"
54
+ ];
55
+ function fe({ service: e }) {
56
+ return /* @__PURE__ */ S("div", {
57
+ className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-xl border border-border-seam bg-[var(--color-accent-soft)]/50 px-4 py-3",
58
+ children: [
59
+ /* @__PURE__ */ x("span", {
60
+ className: "inline-flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-surface text-action-primary-text",
61
+ children: /* @__PURE__ */ x(_, { className: "size-5" })
62
+ }),
63
+ /* @__PURE__ */ x("span", {
64
+ className: "text-base font-semibold text-text-primary",
65
+ children: e.name
66
+ }),
67
+ /* @__PURE__ */ x("span", {
68
+ "aria-hidden": !0,
69
+ className: "text-text-muted",
70
+ children: "·"
71
+ }),
72
+ /* @__PURE__ */ x("span", {
73
+ className: "text-sm text-text-secondary",
74
+ children: e.agency?.name ?? "Agency"
75
+ }),
76
+ /* @__PURE__ */ x("span", {
77
+ "aria-hidden": !0,
78
+ className: "text-text-muted",
79
+ children: "·"
80
+ }),
81
+ /* @__PURE__ */ x("span", {
82
+ className: "text-sm text-text-secondary",
83
+ children: e.feeType === "FREE" ? "Free" : r(e.feeAmount, e.currency)
84
+ }),
85
+ /* @__PURE__ */ x("span", {
86
+ "aria-hidden": !0,
87
+ className: "text-text-muted",
88
+ children: "·"
89
+ }),
90
+ /* @__PURE__ */ S("span", {
91
+ className: "inline-flex items-center gap-1 text-sm text-text-secondary",
92
+ children: [
93
+ /* @__PURE__ */ x(g, { className: "size-3.5" }),
94
+ " ",
95
+ e.slaDays,
96
+ "-day SLA"
97
+ ]
98
+ })
99
+ ]
100
+ });
101
+ }
102
+ function P() {
103
+ let { navigateTo: m } = e(), [g] = ce(), b = g.get("serviceId") ?? void 0, [P, me] = p(b), [F, I] = p(!1), L = P ?? b, R = ee({
48
104
  status: "PUBLISHED",
49
105
  pagination: { limit: 50 }
50
- }), { data: L, isLoading: R, isError: z, refetch: B } = o(F), V = a(), H = c(), U = p(() => te(L?.formSchema ?? null), [L?.formSchema]), [W, G] = m({}), [K, q] = m(""), [J, Y] = m(""), [X, re] = m("NORMAL"), Z = (e, t) => G((n) => ({
106
+ }), { data: z, isLoading: he, isError: ge, refetch: _e } = s(L), B = o(), V = te(), H = ae(() => de(z?.formSchema ?? null), [z?.formSchema]), [U, ve] = p({}), [W, ye] = p({}), [be, G] = p(null), [K, xe] = p(""), [q, Se] = p(""), [J, Ce] = p("NORMAL"), Y = (e, t) => ve((n) => ({
51
107
  ...n,
52
108
  [e]: t
53
- })), ie = () => {
54
- if (U.length > 0) {
109
+ })), we = async (e, t) => {
110
+ let n = t?.[0];
111
+ if (n) {
112
+ G(e);
113
+ try {
114
+ let t = await re(n, ne.documents);
115
+ Y(e, t.id), ye((n) => ({
116
+ ...n,
117
+ [e]: t.name
118
+ }));
119
+ } catch (e) {
120
+ d.error("Upload failed", u(e));
121
+ } finally {
122
+ G(null);
123
+ }
124
+ }
125
+ }, Te = () => {
126
+ if (H.length > 0) {
55
127
  let e = {};
56
- for (let t of U) e[t.key] = W[t.key] ?? "";
128
+ for (let t of H) e[t.key] = U[t.key] ?? "";
57
129
  return e;
58
130
  }
59
131
  return K.trim() ? { details: K.trim() } : {};
60
- }, ae = U.some((e) => e.required && !(W[e.key] ?? "").trim()), Q = async (e) => {
61
- if (F) try {
62
- let t = await V.mutateAsync({
63
- serviceId: F,
64
- formData: ie(),
65
- priority: X,
66
- reference: J.trim() || null
132
+ }, X = H.some((e) => e.required && !(U[e.key] ?? "").trim()), Z = async (e) => {
133
+ if (L) try {
134
+ let t = await B.mutateAsync({
135
+ serviceId: L,
136
+ formData: Te(),
137
+ priority: J,
138
+ reference: q.trim() || null
67
139
  });
68
- e ? (await H.mutateAsync(t.id), f.success("Application submitted", t.reference)) : f.success("Draft saved", t.reference), j(`applications/${t.id}`);
140
+ e ? (await V.mutateAsync(t.id), d.success("Application submitted", t.reference)) : d.success("Draft saved", t.reference), m(`applications/${t.id}`);
69
141
  } catch (e) {
70
- f.error("Could not file the application", d(e));
142
+ d.error("Could not file the application", u(e));
71
143
  }
72
- }, $ = V.isPending || H.isPending;
73
- return F ? /* @__PURE__ */ y(t, {
144
+ }, Q = B.isPending || V.isPending, Ee = L ? F ? 2 : 1 : 0, De = [
145
+ {
146
+ key: N[0],
147
+ label: "Choose service"
148
+ },
149
+ {
150
+ key: N[1],
151
+ label: "Fill form"
152
+ },
153
+ {
154
+ key: N[2],
155
+ label: "Review & submit"
156
+ }
157
+ ], Oe = (e) => e.type === "file" ? W[e.key] ?? "" : U[e.key] ?? "", $ = /* @__PURE__ */ x(ie, {
158
+ steps: De,
159
+ current: Ee,
160
+ className: "mb-6"
161
+ });
162
+ return L ? /* @__PURE__ */ S(n, {
74
163
  title: "New application",
75
164
  back: {
76
165
  label: "Applications",
77
- onClick: () => j("applications")
166
+ onClick: () => m("applications")
78
167
  },
79
- description: L ? `Applying for ${L.name}` : "Loading service…",
80
- children: R ? /* @__PURE__ */ y(u, { label: "Loading service…" }) : z || !L ? /* @__PURE__ */ y(l, {
168
+ description: z ? `Applying for ${z.name}` : "Loading service…",
169
+ children: [$, he ? /* @__PURE__ */ x(l, { label: "Loading service…" }) : ge || !z ? /* @__PURE__ */ x(c, {
81
170
  message: "We couldn't load this service.",
82
- onRetry: () => B()
83
- }) : /* @__PURE__ */ b(ee, {
84
- treatment: "plain",
85
- className: "max-w-2xl border-border-seam p-6",
86
- children: [/* @__PURE__ */ b("div", {
87
- className: "mb-5 flex flex-wrap items-center gap-2",
88
- children: [
89
- /* @__PURE__ */ y(r, { status: L.category }),
90
- /* @__PURE__ */ y(r, { status: L.feeType }),
91
- /* @__PURE__ */ b("span", {
92
- className: "text-sm text-text-secondary",
93
- children: [
94
- L.feeType === "FREE" ? "No fee" : n(L.feeAmount, L.currency),
95
- " ",
96
- "· ",
97
- L.slaDays,
98
- " day SLA"
99
- ]
100
- })
101
- ]
102
- }), /* @__PURE__ */ b("div", {
103
- className: "flex flex-col gap-4",
171
+ onRetry: () => _e()
172
+ }) : /* @__PURE__ */ S("div", {
173
+ className: "max-w-3xl space-y-4",
174
+ children: [/* @__PURE__ */ x(fe, { service: z }), F ? /* @__PURE__ */ S(w, {
175
+ treatment: "plain",
176
+ className: "border-border-seam p-6",
104
177
  children: [
105
- /* @__PURE__ */ b("div", {
106
- className: "grid gap-4 sm:grid-cols-2",
107
- children: [/* @__PURE__ */ b("div", {
108
- className: "grid gap-1.5",
109
- children: [/* @__PURE__ */ y(C, {
110
- htmlFor: "app-ref",
111
- children: "Reference (optional)"
112
- }), /* @__PURE__ */ y(S, {
113
- id: "app-ref",
114
- value: J,
115
- onChange: (e) => Y(e.target.value),
116
- placeholder: "Auto-generated if left blank"
117
- })]
118
- }), /* @__PURE__ */ b("div", {
119
- className: "grid gap-1.5",
120
- children: [/* @__PURE__ */ y(C, { children: "Priority" }), /* @__PURE__ */ b(w, {
121
- value: X,
122
- onValueChange: (e) => re(e),
123
- children: [/* @__PURE__ */ y(D, {
124
- "aria-label": "Priority",
125
- children: /* @__PURE__ */ y(O, {})
126
- }), /* @__PURE__ */ y(T, { children: A.map((e) => /* @__PURE__ */ y(E, {
127
- value: e,
128
- children: e.charAt(0) + e.slice(1).toLowerCase()
129
- }, e)) })]
130
- })]
131
- })]
178
+ /* @__PURE__ */ x("h2", {
179
+ className: "text-lg font-semibold text-text-primary",
180
+ children: "Review your application"
132
181
  }),
133
- U.length > 0 ? U.map((e) => /* @__PURE__ */ b("div", {
134
- className: "grid gap-1.5",
135
- children: [/* @__PURE__ */ b(C, {
136
- htmlFor: `f-${e.key}`,
137
- children: [e.label, e.required && /* @__PURE__ */ y("span", {
138
- className: "text-status-error-text",
139
- children: " *"
140
- })]
141
- }), e.type === "textarea" ? /* @__PURE__ */ y(k, {
142
- id: `f-${e.key}`,
143
- value: W[e.key] ?? "",
144
- onChange: (t) => Z(e.key, t.target.value),
145
- rows: 3
146
- }) : e.type === "select" ? /* @__PURE__ */ b(w, {
147
- value: W[e.key] ?? "",
148
- onValueChange: (t) => Z(e.key, t),
149
- children: [/* @__PURE__ */ y(D, {
150
- "aria-label": e.label,
151
- children: /* @__PURE__ */ y(O, { placeholder: "Select…" })
152
- }), /* @__PURE__ */ y(T, { children: (e.options ?? []).map((e) => /* @__PURE__ */ y(E, {
153
- value: e,
154
- children: e
155
- }, e)) })]
156
- }) : /* @__PURE__ */ y(S, {
157
- id: `f-${e.key}`,
158
- type: e.type === "number" ? "number" : "text",
159
- value: W[e.key] ?? "",
160
- onChange: (t) => Z(e.key, t.target.value)
161
- })]
162
- }, e.key)) : /* @__PURE__ */ b("div", {
163
- className: "grid gap-1.5",
164
- children: [/* @__PURE__ */ y(C, {
165
- htmlFor: "app-details",
166
- children: "Application details"
167
- }), /* @__PURE__ */ y(k, {
168
- id: "app-details",
169
- value: K,
170
- onChange: (e) => q(e.target.value),
171
- placeholder: "Describe your request and include any relevant information.",
172
- rows: 5
173
- })]
182
+ /* @__PURE__ */ x("p", {
183
+ className: "mt-0.5 text-sm text-text-muted",
184
+ children: "Check the details below, then submit or save as a draft."
174
185
  }),
175
- L.requiredDocuments.length > 0 && /* @__PURE__ */ b("p", {
176
- className: "rounded-lg bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
186
+ /* @__PURE__ */ S("div", {
187
+ className: "mt-5 space-y-5",
177
188
  children: [
178
- "You will be able to upload the required documents (",
179
- L.requiredDocuments.join(", "),
180
- ") from the application page after filing."
189
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h3", {
190
+ className: "mb-2 text-sm font-semibold text-text-secondary",
191
+ children: "Application"
192
+ }), /* @__PURE__ */ x(f, {
193
+ items: [
194
+ {
195
+ label: "Service",
196
+ value: z.name
197
+ },
198
+ {
199
+ label: "Agency",
200
+ value: z.agency?.name ?? "—"
201
+ },
202
+ {
203
+ label: "Priority",
204
+ value: J.charAt(0) + J.slice(1).toLowerCase()
205
+ },
206
+ {
207
+ label: "Reference",
208
+ value: q.trim() || "Auto-generated"
209
+ }
210
+ ],
211
+ columns: 2
212
+ })] }),
213
+ H.length > 0 && /* @__PURE__ */ S("div", {
214
+ className: "border-t border-border-seam pt-4",
215
+ children: [/* @__PURE__ */ x("h3", {
216
+ className: "mb-2 text-sm font-semibold text-text-secondary",
217
+ children: "Your answers"
218
+ }), /* @__PURE__ */ x(f, {
219
+ variant: "stacked",
220
+ columns: 2,
221
+ items: H.map((e) => ({
222
+ label: /* @__PURE__ */ S(le, { children: [e.label, e.required && /* @__PURE__ */ x("span", {
223
+ className: "text-status-error-text",
224
+ children: " *"
225
+ })] }),
226
+ value: Oe(e) || /* @__PURE__ */ x("span", {
227
+ className: "text-text-muted",
228
+ children: "Not provided"
229
+ })
230
+ }))
231
+ })]
232
+ }),
233
+ H.length === 0 && K.trim() && /* @__PURE__ */ S("div", {
234
+ className: "border-t border-border-seam pt-4",
235
+ children: [/* @__PURE__ */ x("h3", {
236
+ className: "mb-1.5 text-sm font-semibold text-text-secondary",
237
+ children: "Details"
238
+ }), /* @__PURE__ */ x("p", {
239
+ className: "whitespace-pre-wrap text-sm text-text-primary",
240
+ children: K.trim()
241
+ })]
242
+ })
181
243
  ]
182
244
  }),
183
- /* @__PURE__ */ b("div", {
184
- className: "mt-2 flex flex-wrap justify-end gap-2",
185
- children: [/* @__PURE__ */ b(x, {
186
- variant: "outline",
187
- onClick: () => Q(!1),
188
- disabled: $,
189
- children: [/* @__PURE__ */ y(g, { className: "mr-1.5 h-4 w-4" }), " Save draft"]
190
- }), /* @__PURE__ */ b(x, {
191
- onClick: () => Q(!0),
192
- disabled: $ || ae,
193
- children: [/* @__PURE__ */ y(_, { className: "mr-1.5 h-4 w-4" }), " Submit application"]
245
+ /* @__PURE__ */ S("div", {
246
+ className: "mt-6 flex flex-col gap-2 sm:flex-row sm:justify-between",
247
+ children: [/* @__PURE__ */ S(C, {
248
+ variant: "ghost",
249
+ onClick: () => I(!1),
250
+ disabled: Q,
251
+ children: [/* @__PURE__ */ x(oe, { className: "mr-1.5 h-4 w-4" }), " Back to edit"]
252
+ }), /* @__PURE__ */ S("div", {
253
+ className: "flex flex-col gap-2 sm:flex-row",
254
+ children: [/* @__PURE__ */ S(C, {
255
+ variant: "outline",
256
+ onClick: () => Z(!1),
257
+ disabled: Q,
258
+ children: [/* @__PURE__ */ x(y, { className: "mr-1.5 h-4 w-4" }), " Save draft"]
259
+ }), /* @__PURE__ */ S(C, {
260
+ onClick: () => Z(!0),
261
+ disabled: Q || X,
262
+ children: [Q ? /* @__PURE__ */ x(v, { className: "mr-1.5 h-4 w-4 animate-spin" }) : /* @__PURE__ */ x(se, { className: "mr-1.5 h-4 w-4" }), "Submit application"]
263
+ })]
194
264
  })]
195
265
  })
196
266
  ]
267
+ }) : /* @__PURE__ */ x(w, {
268
+ treatment: "plain",
269
+ className: "border-border-seam p-6",
270
+ children: /* @__PURE__ */ S("div", {
271
+ className: "flex flex-col gap-4",
272
+ children: [
273
+ /* @__PURE__ */ S("div", {
274
+ className: "grid gap-4 sm:grid-cols-2",
275
+ children: [/* @__PURE__ */ S("div", {
276
+ className: "grid gap-1.5",
277
+ children: [/* @__PURE__ */ x(E, {
278
+ htmlFor: "app-ref",
279
+ children: "Reference (optional)"
280
+ }), /* @__PURE__ */ x(T, {
281
+ id: "app-ref",
282
+ value: q,
283
+ onChange: (e) => Se(e.target.value),
284
+ placeholder: "Auto-generated if left blank"
285
+ })]
286
+ }), /* @__PURE__ */ S("div", {
287
+ className: "grid gap-1.5",
288
+ children: [/* @__PURE__ */ x(E, { children: "Priority" }), /* @__PURE__ */ S(D, {
289
+ value: J,
290
+ onValueChange: (e) => Ce(e),
291
+ children: [/* @__PURE__ */ x(A, {
292
+ "aria-label": "Priority",
293
+ children: /* @__PURE__ */ x(j, {})
294
+ }), /* @__PURE__ */ x(O, { children: ue.map((e) => /* @__PURE__ */ x(k, {
295
+ value: e,
296
+ children: e.charAt(0) + e.slice(1).toLowerCase()
297
+ }, e)) })]
298
+ })]
299
+ })]
300
+ }),
301
+ H.length > 0 ? /* @__PURE__ */ x("div", {
302
+ className: "grid gap-4 sm:grid-cols-2",
303
+ children: H.map((e) => /* @__PURE__ */ S("div", {
304
+ className: t("grid gap-1.5", e.type === "textarea" || e.type === "file" ? "sm:col-span-2" : ""),
305
+ children: [/* @__PURE__ */ S(E, {
306
+ htmlFor: `f-${e.key}`,
307
+ children: [e.label, e.required && /* @__PURE__ */ x("span", {
308
+ className: "text-status-error-text",
309
+ children: " *"
310
+ })]
311
+ }), e.type === "textarea" ? /* @__PURE__ */ x(M, {
312
+ id: `f-${e.key}`,
313
+ value: U[e.key] ?? "",
314
+ onChange: (t) => Y(e.key, t.target.value),
315
+ rows: 3
316
+ }) : e.type === "select" ? /* @__PURE__ */ S(D, {
317
+ value: U[e.key] ?? "",
318
+ onValueChange: (t) => Y(e.key, t),
319
+ children: [/* @__PURE__ */ x(A, {
320
+ id: `f-${e.key}`,
321
+ "aria-label": e.label,
322
+ children: /* @__PURE__ */ x(j, { placeholder: "Select…" })
323
+ }), /* @__PURE__ */ x(O, { children: (e.options ?? []).map((e) => /* @__PURE__ */ x(k, {
324
+ value: e,
325
+ children: e
326
+ }, e)) })]
327
+ }) : e.type === "file" ? /* @__PURE__ */ x(pe, {
328
+ id: `f-${e.key}`,
329
+ label: e.label,
330
+ fileName: W[e.key],
331
+ uploading: be === e.key,
332
+ onSelect: (t) => we(e.key, t)
333
+ }) : /* @__PURE__ */ x(T, {
334
+ id: `f-${e.key}`,
335
+ type: e.type === "number" ? "number" : e.type === "date" ? "date" : "text",
336
+ value: U[e.key] ?? "",
337
+ onChange: (t) => Y(e.key, t.target.value)
338
+ })]
339
+ }, e.key))
340
+ }) : /* @__PURE__ */ S("div", {
341
+ className: "grid gap-1.5",
342
+ children: [/* @__PURE__ */ x(E, {
343
+ htmlFor: "app-details",
344
+ children: "Application details"
345
+ }), /* @__PURE__ */ x(M, {
346
+ id: "app-details",
347
+ value: K,
348
+ onChange: (e) => xe(e.target.value),
349
+ placeholder: "Describe your request and include any relevant information.",
350
+ rows: 5
351
+ })]
352
+ }),
353
+ z.requiredDocuments.length > 0 && /* @__PURE__ */ S("p", {
354
+ className: "rounded-lg bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
355
+ children: [
356
+ "You will be able to upload the required documents (",
357
+ z.requiredDocuments.join(", "),
358
+ ") from the application page after filing."
359
+ ]
360
+ }),
361
+ X && /* @__PURE__ */ S("p", {
362
+ className: "text-xs text-text-muted",
363
+ children: [
364
+ "Fields marked ",
365
+ /* @__PURE__ */ x("span", {
366
+ className: "text-status-error-text",
367
+ children: "*"
368
+ }),
369
+ " are required to submit — you can still save a draft."
370
+ ]
371
+ }),
372
+ /* @__PURE__ */ S("div", {
373
+ className: "mt-2 flex flex-col gap-2 sm:flex-row sm:justify-end",
374
+ children: [/* @__PURE__ */ S(C, {
375
+ variant: "outline",
376
+ onClick: () => Z(!1),
377
+ disabled: Q,
378
+ children: [/* @__PURE__ */ x(y, { className: "mr-1.5 h-4 w-4" }), " Save draft"]
379
+ }), /* @__PURE__ */ S(C, {
380
+ onClick: () => I(!0),
381
+ disabled: Q,
382
+ children: ["Review & submit ", /* @__PURE__ */ x(h, { className: "ml-1.5 h-4 w-4" })]
383
+ })]
384
+ })
385
+ ]
386
+ })
197
387
  })]
198
- })
199
- }) : /* @__PURE__ */ y(t, {
388
+ })]
389
+ }) : /* @__PURE__ */ S(n, {
200
390
  title: "New application",
201
391
  back: {
202
392
  label: "Applications",
203
- onClick: () => j("applications")
393
+ onClick: () => m("applications")
204
394
  },
205
395
  description: "Choose the service you want to apply for.",
206
- children: I.isLoading ? /* @__PURE__ */ y(u, { label: "Loading services…" }) : I.isError ? /* @__PURE__ */ y(l, {
396
+ children: [$, R.isLoading ? /* @__PURE__ */ x(l, { label: "Loading services…" }) : R.isError ? /* @__PURE__ */ x(c, {
207
397
  message: "We couldn't load services.",
208
- onRetry: () => I.refetch()
209
- }) : (I.data?.items.length ?? 0) === 0 ? /* @__PURE__ */ y(i, {
398
+ onRetry: () => R.refetch()
399
+ }) : (R.data?.items.length ?? 0) === 0 ? /* @__PURE__ */ x(a, {
210
400
  illustration: "empty-data",
211
401
  title: "No published services",
212
402
  description: "There are no services available to apply for yet. Publish a service first.",
213
- action: /* @__PURE__ */ y(x, {
214
- onClick: () => j("services"),
403
+ action: /* @__PURE__ */ x(C, {
404
+ onClick: () => m("services"),
215
405
  children: "Go to services"
216
406
  })
217
- }) : /* @__PURE__ */ y("div", {
407
+ }) : /* @__PURE__ */ x("div", {
218
408
  className: "grid gap-3 sm:grid-cols-2",
219
- children: I.data?.items.map((e) => /* @__PURE__ */ b("button", {
409
+ children: R.data?.items.map((e) => /* @__PURE__ */ S("button", {
220
410
  type: "button",
221
- onClick: () => ne(e.id),
411
+ onClick: () => me(e.id),
222
412
  className: "group flex items-center gap-3 rounded-xl border border-border-seam bg-bg-surface p-4 text-left outline-none transition-colors hover:bg-bg-sunken focus-visible:ring-1 focus-visible:ring-border-focus",
223
- children: [/* @__PURE__ */ b("div", {
224
- className: "min-w-0 flex-1",
225
- children: [
226
- /* @__PURE__ */ y("p", {
227
- className: "truncate font-medium text-text-primary",
228
- children: e.name
229
- }),
230
- /* @__PURE__ */ y("p", {
231
- className: "truncate text-xs text-text-muted",
232
- children: e.agency?.name ?? "Agency"
233
- }),
234
- /* @__PURE__ */ b("div", {
235
- className: "mt-2 flex items-center gap-2",
236
- children: [/* @__PURE__ */ y(r, { status: e.category }), /* @__PURE__ */ y("span", {
237
- className: "text-xs text-text-secondary",
238
- children: e.feeType === "FREE" ? "Free" : n(e.feeAmount, e.currency)
239
- })]
240
- })
241
- ]
242
- }), /* @__PURE__ */ y(h, { className: "h-4 w-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5" })]
413
+ children: [
414
+ /* @__PURE__ */ x("span", {
415
+ className: "inline-flex size-10 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-action-primary-text",
416
+ children: /* @__PURE__ */ x(_, { className: "size-5" })
417
+ }),
418
+ /* @__PURE__ */ S("div", {
419
+ className: "min-w-0 flex-1",
420
+ children: [
421
+ /* @__PURE__ */ x("p", {
422
+ className: "truncate font-medium text-text-primary",
423
+ children: e.name
424
+ }),
425
+ /* @__PURE__ */ x("p", {
426
+ className: "truncate text-xs text-text-muted",
427
+ children: e.agency?.name ?? "Agency"
428
+ }),
429
+ /* @__PURE__ */ S("div", {
430
+ className: "mt-2 flex items-center gap-2",
431
+ children: [/* @__PURE__ */ x(i, { status: e.category }), /* @__PURE__ */ x("span", {
432
+ className: "text-xs text-text-secondary",
433
+ children: e.feeType === "FREE" ? "Free" : r(e.feeAmount, e.currency)
434
+ })]
435
+ })
436
+ ]
437
+ }),
438
+ /* @__PURE__ */ x(h, { className: "h-4 w-4 shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5" })
439
+ ]
243
440
  }, e.id))
244
- })
441
+ })]
442
+ });
443
+ }
444
+ function pe({ id: e, label: n, fileName: r, uploading: i, onSelect: a }) {
445
+ return /* @__PURE__ */ S("label", {
446
+ htmlFor: e,
447
+ className: t("flex cursor-pointer items-center gap-3 rounded-xl border-2 border-dashed border-border-seam bg-bg-sunken/40 px-4 py-4 transition-colors hover:border-border-strong", i && "cursor-wait opacity-70"),
448
+ children: [
449
+ /* @__PURE__ */ x("span", {
450
+ className: "inline-flex size-9 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-action-primary-text",
451
+ children: i ? /* @__PURE__ */ x(v, {
452
+ className: "size-5 animate-spin",
453
+ "aria-hidden": "true"
454
+ }) : r ? /* @__PURE__ */ x(m, {
455
+ className: "size-5 text-status-success-text",
456
+ "aria-hidden": "true"
457
+ }) : /* @__PURE__ */ x(b, {
458
+ className: "size-5",
459
+ "aria-hidden": "true"
460
+ })
461
+ }),
462
+ /* @__PURE__ */ S("span", {
463
+ className: "min-w-0 flex-1",
464
+ children: [/* @__PURE__ */ x("span", {
465
+ className: "block truncate text-sm font-medium text-text-primary",
466
+ children: i ? "Uploading…" : r || "Click to upload or drag & drop"
467
+ }), /* @__PURE__ */ x("span", {
468
+ className: "mt-0.5 block text-xs text-text-muted",
469
+ children: r ? "Uploaded · click to replace" : "PDF, JPG or PNG"
470
+ })]
471
+ }),
472
+ /* @__PURE__ */ x("input", {
473
+ id: e,
474
+ type: "file",
475
+ className: "sr-only",
476
+ "aria-label": `Upload ${n}`,
477
+ disabled: i,
478
+ onChange: (e) => {
479
+ a(e.target.files), e.target.value = "";
480
+ }
481
+ })
482
+ ]
245
483
  });
246
484
  }
247
485
  //#endregion
248
- export { j as NewApplicationPage };
486
+ export { P as NewApplicationPage };
249
487
 
250
488
  //# sourceMappingURL=NewApplicationPage.js.map