@burdenoff/microfe-crewfoundry 2026.1013.1 → 2026.1013.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 (24) hide show
  1. package/dist/crewfoundry/components/forms/FormModal.d.ts +25 -1
  2. package/dist/crewfoundry/components/forms/FormModal.d.ts.map +1 -1
  3. package/dist/crewfoundry/components/forms/FormModal.js +151 -136
  4. package/dist/crewfoundry/components/forms/FormModal.js.map +1 -1
  5. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.d.ts.map +1 -1
  6. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.js +49 -49
  7. package/dist/crewfoundry/pages/AnalyticsHiringAnalyticsPagePage.js.map +1 -1
  8. package/dist/crewfoundry/pages/HiringCreateJobPagePage.d.ts.map +1 -1
  9. package/dist/crewfoundry/pages/HiringCreateJobPagePage.js +260 -115
  10. package/dist/crewfoundry/pages/HiringCreateJobPagePage.js.map +1 -1
  11. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.d.ts.map +1 -1
  12. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js +199 -166
  13. package/dist/crewfoundry/pages/HiringJobDetailsPagePage.js.map +1 -1
  14. package/dist/crewfoundry/pages/HiringJobsPagePage.d.ts.map +1 -1
  15. package/dist/crewfoundry/pages/HiringJobsPagePage.js +118 -104
  16. package/dist/crewfoundry/pages/HiringJobsPagePage.js.map +1 -1
  17. package/dist/crewfoundry/store/crewfoundryStore.d.ts +1 -1
  18. package/dist/crewfoundry/store/crewfoundryStore.d.ts.map +1 -1
  19. package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
  20. package/dist/crewfoundry/utils/dateUtils.d.ts +47 -0
  21. package/dist/crewfoundry/utils/dateUtils.d.ts.map +1 -0
  22. package/dist/crewfoundry/utils/dateUtils.js +22 -0
  23. package/dist/crewfoundry/utils/dateUtils.js.map +1 -0
  24. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
1
  import { useCrewFoundryStore as e } from "../store/crewfoundryStore.js";
2
2
  import { newClientId as t } from "../components/forms/formValues.js";
3
- import { useMemo as n, useState as r } from "react";
4
- import { Briefcase as i, ChevronRight as a, Plus as o, Save as s, X as c } from "lucide-react";
5
- import { useNavigate as l } from "react-router";
3
+ import { localTodayString as n } from "../utils/dateUtils.js";
4
+ import { useMemo as r, useState as i } from "react";
5
+ import { AlertCircle as a, Briefcase as o, ChevronRight as s, Plus as c, Save as l, X as ee } from "lucide-react";
6
+ import { useNavigate as te } from "react-router";
6
7
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { Button as f, GlassCard as ee, GradientText as p, Input as m, PagePurpose as h, Textarea as g } from "@burdenoff/fe-libs/ui";
8
+ import { Button as f, GlassCard as p, GradientText as m, Input as h, PagePurpose as ne, Textarea as g } from "@burdenoff/fe-libs/ui";
8
9
  import { useGlobalUi as _ } from "@burdenoff/fe-libs/shared/providers/shell";
9
10
  //#region src/crewfoundry/pages/HiringCreateJobPagePage.tsx
10
11
  var v = "flex h-10 w-full rounded-input border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary transition-colors duration-200 focus-visible:border-border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", y = "text-sm font-medium text-text-primary", b = [
@@ -20,7 +21,7 @@ var v = "flex h-10 w-full rounded-input border border-border-default bg-bg-surfa
20
21
  label: "Contract",
21
22
  value: "contract"
22
23
  }
23
- ], x = [
24
+ ], re = [
24
25
  {
25
26
  label: "Entry",
26
27
  value: "entry"
@@ -42,54 +43,117 @@ var v = "flex h-10 w-full rounded-input border border-border-default bg-bg-surfa
42
43
  value: "executive"
43
44
  }
44
45
  ];
45
- function S({ htmlFor: e, children: t }) {
46
- return /* @__PURE__ */ u("label", {
46
+ function x({ htmlFor: e, required: t, children: n }) {
47
+ return /* @__PURE__ */ d("label", {
47
48
  className: y,
48
49
  htmlFor: e,
49
- children: t
50
+ children: [n, t ? /* @__PURE__ */ u("span", {
51
+ className: "text-status-error-fg",
52
+ children: " *"
53
+ }) : null]
54
+ });
55
+ }
56
+ function S({ id: e, message: t }) {
57
+ return /* @__PURE__ */ d("p", {
58
+ id: e,
59
+ role: "alert",
60
+ className: "flex items-center gap-1 text-xs text-status-error-text",
61
+ children: [/* @__PURE__ */ u(a, {
62
+ className: "h-3 w-3 shrink-0",
63
+ "aria-hidden": !0
64
+ }), /* @__PURE__ */ u("span", { children: t })]
50
65
  });
51
66
  }
52
67
  function C() {
53
- let C = l(), { showToast: w } = _(), T = e((e) => e.addJobPosting), E = e((e) => e.departments), [D, O] = r(""), [k, A] = r(""), [j, te] = r(""), [M, N] = r(""), [P, F] = r("full_time"), [I, L] = r("mid"), [R, z] = r(""), [B, V] = r(""), [H, U] = r(""), [W, G] = r([""]), [K, q] = r([""]), [J, Y] = r(!1), X = n(() => Array.from(new Set(E.map((e) => e.name).filter(Boolean))).sort(), [E]), Z = () => G((e) => [...e, ""]), ne = () => q((e) => [...e, ""]), re = (e, t) => G((n) => n.map((n, r) => r === e ? t : n)), ie = (e, t) => q((n) => n.map((n, r) => r === e ? t : n)), ae = (e) => G((t) => t.filter((t, n) => n !== e)), oe = (e) => q((t) => t.filter((t, n) => n !== e)), Q = async (e) => {
54
- if (J) return;
55
- if (!D.trim()) {
56
- w("Job Title is required", "warning");
68
+ let a = te(), { showToast: C } = _(), w = e((e) => e.addJobPosting), T = e((e) => e.departments), [E, D] = i(""), [O, k] = i(""), [A, j] = i(""), [M, N] = i(""), [P, ie] = i("full_time"), [F, I] = i("mid"), [L, R] = i(""), [z, B] = i(""), [V, H] = i(""), [U, W] = i([""]), [G, K] = i([""]), [q, J] = i(!1), [Y, X] = i({}), Z = (e) => {
69
+ X((t) => {
70
+ if (!(e in t)) return t;
71
+ let n = { ...t };
72
+ return delete n[e], n;
73
+ });
74
+ }, ae = n(), oe = r(() => Array.from(new Set(T.map((e) => e.name).filter(Boolean))).sort(), [T]), se = () => W((e) => [...e, ""]), ce = () => K((e) => [...e, ""]), le = (e, t) => W((n) => n.map((n, r) => r === e ? t : n)), ue = (e, t) => K((n) => n.map((n, r) => r === e ? t : n)), de = (e) => W((t) => t.filter((t, n) => n !== e)), fe = (e) => K((t) => t.filter((t, n) => n !== e)), Q = async (e) => {
75
+ if (q) return;
76
+ let r = (e, t) => {
77
+ C(t, "warning"), X((n) => ({
78
+ ...n,
79
+ [e]: t
80
+ }));
81
+ };
82
+ if (!E.trim()) {
83
+ r("title", "Job Title is required");
84
+ return;
85
+ }
86
+ if (!O.trim()) {
87
+ r("department", "Department is required");
88
+ return;
89
+ }
90
+ if (V.trim() !== "" && V < n()) {
91
+ r("deadline", "Application Deadline cannot be a past date");
92
+ return;
93
+ }
94
+ if (e === "active") {
95
+ if (!A.trim()) {
96
+ r("location", "Location is required");
97
+ return;
98
+ }
99
+ if (!M.trim()) {
100
+ r("description", "Description is required");
101
+ return;
102
+ }
103
+ }
104
+ let i = L.trim() === "" ? 0 : Number(L), o = z.trim() === "" ? 0 : Number(z);
105
+ if (i < 0) {
106
+ r("salaryMin", "Salary Min cannot be negative");
107
+ return;
108
+ }
109
+ if (o < 0) {
110
+ r("salaryMax", "Salary Max cannot be negative");
111
+ return;
112
+ }
113
+ let s = i === 0 && o === 0;
114
+ if (!s && o === 0 && i > 0) {
115
+ r("salaryMax", "Provide Salary Max, or leave both empty");
116
+ return;
117
+ }
118
+ if (!s && o > 0 && i === 0) {
119
+ r("salaryMin", "Provide Salary Min, or leave both empty");
57
120
  return;
58
121
  }
59
- if (!k.trim()) {
60
- w("Department is required", "warning");
122
+ if (!s && o > 0 && o < i) {
123
+ r("salaryMax", "Salary Max cannot be less than Salary Min");
61
124
  return;
62
125
  }
63
- let n = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), r = {
126
+ X({});
127
+ let c = {
64
128
  id: t(),
65
- title: D.trim(),
66
- department: k.trim(),
67
- location: j.trim(),
129
+ title: E.trim(),
130
+ department: O.trim(),
131
+ location: A.trim(),
68
132
  type: P,
69
- experienceLevel: I,
70
- salaryMin: R.trim() === "" ? 0 : Number(R),
71
- salaryMax: B.trim() === "" ? 0 : Number(B),
133
+ experienceLevel: F,
134
+ salaryMin: i,
135
+ salaryMax: o,
72
136
  status: e,
73
137
  applicants: 0,
74
- postedDate: n,
75
- deadline: H.trim() === "" ? n : H,
138
+ postedDate: n(),
139
+ deadline: V.trim() === "" ? null : V,
76
140
  description: M.trim(),
77
- requirements: W.map((e) => e.trim()).filter(Boolean),
78
- benefits: K.map((e) => e.trim()).filter(Boolean)
141
+ requirements: U.map((e) => e.trim()).filter(Boolean),
142
+ benefits: G.map((e) => e.trim()).filter(Boolean)
79
143
  };
80
- Y(!0);
144
+ J(!0);
81
145
  try {
82
- await T(r), w(e === "draft" ? "Draft saved" : "Job published", "success"), C("../hiring/jobs-page");
146
+ await w(c), C(e === "draft" ? "Draft saved" : "Job published", "success"), a("../hiring/jobs-page");
83
147
  } catch (e) {
84
- w(e instanceof Error ? e.message : "Unable to save job posting", "error");
148
+ C(e instanceof Error ? e.message : "Unable to save job posting", "error");
85
149
  } finally {
86
- Y(!1);
150
+ J(!1);
87
151
  }
88
152
  }, $ = (e, t, n, r, i, a) => /* @__PURE__ */ d("div", {
89
153
  className: "space-y-2",
90
154
  children: [e.map((e, r) => /* @__PURE__ */ d("div", {
91
155
  className: "relative",
92
- children: [/* @__PURE__ */ u(m, {
156
+ children: [/* @__PURE__ */ u(h, {
93
157
  className: "pr-9",
94
158
  placeholder: a,
95
159
  value: e,
@@ -99,7 +163,7 @@ function C() {
99
163
  "aria-label": `Remove ${i.toLowerCase()} ${r + 1}`,
100
164
  onClick: () => n(r),
101
165
  className: "absolute right-2.5 top-1/2 -translate-y-1/2 rounded-sm p-0.5 text-text-secondary transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:text-text-primary",
102
- children: /* @__PURE__ */ u(c, { className: "h-4 w-4" })
166
+ children: /* @__PURE__ */ u(ee, { className: "h-4 w-4" })
103
167
  })]
104
168
  }, r)), /* @__PURE__ */ d(f, {
105
169
  variant: "link",
@@ -108,7 +172,7 @@ function C() {
108
172
  onClick: r,
109
173
  type: "button",
110
174
  children: [
111
- /* @__PURE__ */ u(o, { className: "h-4 w-4 mr-1" }),
175
+ /* @__PURE__ */ u(c, { className: "h-4 w-4 mr-1" }),
112
176
  "Add ",
113
177
  i
114
178
  ]
@@ -124,11 +188,11 @@ function C() {
124
188
  children: [
125
189
  /* @__PURE__ */ u("button", {
126
190
  type: "button",
127
- onClick: () => C("../hiring/jobs-page"),
191
+ onClick: () => a("../hiring/jobs-page"),
128
192
  className: "rounded-sm transition-colors hover:text-text-primary focus-visible:outline-none focus-visible:text-text-primary",
129
193
  children: "Hiring"
130
194
  }),
131
- /* @__PURE__ */ u(a, { className: "h-3.5 w-3.5" }),
195
+ /* @__PURE__ */ u(s, { className: "h-3.5 w-3.5" }),
132
196
  /* @__PURE__ */ u("span", {
133
197
  className: "text-text-primary",
134
198
  children: "Post New Job"
@@ -136,17 +200,17 @@ function C() {
136
200
  ]
137
201
  }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h1", {
138
202
  className: "text-2xl font-semibold",
139
- children: /* @__PURE__ */ u(p, { children: "Create Job Posting" })
140
- }), /* @__PURE__ */ u(h, {
203
+ children: /* @__PURE__ */ u(m, { children: "Create Job Posting" })
204
+ }), /* @__PURE__ */ u(ne, {
141
205
  className: "mt-1",
142
206
  children: "Create a new job posting — define the role, requirements, and compensation here to start attracting and collecting applicants."
143
207
  })] })]
144
- }), /* @__PURE__ */ d(ee, {
208
+ }), /* @__PURE__ */ d(p, {
145
209
  treatment: "glass",
146
210
  className: "max-w-5xl p-6",
147
211
  children: [/* @__PURE__ */ d("div", {
148
212
  className: "mb-6 flex items-center gap-2 text-lg font-semibold text-text-primary",
149
- children: [/* @__PURE__ */ u(i, { className: "h-5 w-5" }), "Job details"]
213
+ children: [/* @__PURE__ */ u(o, { className: "h-5 w-5" }), "Job details"]
150
214
  }), /* @__PURE__ */ d("div", {
151
215
  className: "space-y-5",
152
216
  children: [
@@ -154,25 +218,38 @@ function C() {
154
218
  className: "grid grid-cols-1 gap-5 md:grid-cols-2",
155
219
  children: [/* @__PURE__ */ d("div", {
156
220
  className: "space-y-2",
157
- children: [/* @__PURE__ */ u(S, {
158
- htmlFor: "job-title",
159
- children: "Job Title"
160
- }), /* @__PURE__ */ u(m, {
161
- id: "job-title",
162
- placeholder: "e.g. Senior Frontend Developer",
163
- value: D,
164
- onChange: (e) => O(e.target.value)
165
- })]
221
+ children: [
222
+ /* @__PURE__ */ u(x, {
223
+ htmlFor: "job-title",
224
+ required: !0,
225
+ children: "Job Title"
226
+ }),
227
+ /* @__PURE__ */ u(h, {
228
+ id: "job-title",
229
+ placeholder: "e.g. Senior Frontend Developer",
230
+ value: E,
231
+ "aria-invalid": !!Y.title || void 0,
232
+ "aria-describedby": Y.title ? "job-title-error" : void 0,
233
+ onChange: (e) => {
234
+ D(e.target.value), Z("title");
235
+ }
236
+ }),
237
+ Y.title ? /* @__PURE__ */ u(S, {
238
+ id: "job-title-error",
239
+ message: Y.title
240
+ }) : null
241
+ ]
166
242
  }), /* @__PURE__ */ d("div", {
167
243
  className: "space-y-2",
168
- children: [/* @__PURE__ */ u(S, {
244
+ children: [/* @__PURE__ */ u(x, {
169
245
  htmlFor: "job-type",
246
+ required: !0,
170
247
  children: "Employment Type"
171
248
  }), /* @__PURE__ */ u("select", {
172
249
  id: "job-type",
173
250
  className: v,
174
251
  value: P,
175
- onChange: (e) => F(e.target.value),
252
+ onChange: (e) => ie(e.target.value),
176
253
  children: b.map((e) => /* @__PURE__ */ u("option", {
177
254
  value: e.value,
178
255
  children: e.label
@@ -185,33 +262,43 @@ function C() {
185
262
  children: [/* @__PURE__ */ d("div", {
186
263
  className: "space-y-2",
187
264
  children: [
188
- /* @__PURE__ */ u(S, {
265
+ /* @__PURE__ */ u(x, {
189
266
  htmlFor: "job-department",
267
+ required: !0,
190
268
  children: "Department"
191
269
  }),
192
- /* @__PURE__ */ u(m, {
270
+ /* @__PURE__ */ u(h, {
193
271
  id: "job-department",
194
272
  list: "crewfoundry-department-options",
195
273
  placeholder: "e.g. Engineering",
196
- value: k,
197
- onChange: (e) => A(e.target.value)
274
+ value: O,
275
+ "aria-invalid": !!Y.department || void 0,
276
+ "aria-describedby": Y.department ? "job-department-error" : void 0,
277
+ onChange: (e) => {
278
+ k(e.target.value), Z("department");
279
+ }
198
280
  }),
281
+ Y.department ? /* @__PURE__ */ u(S, {
282
+ id: "job-department-error",
283
+ message: Y.department
284
+ }) : null,
199
285
  /* @__PURE__ */ u("datalist", {
200
286
  id: "crewfoundry-department-options",
201
- children: X.map((e) => /* @__PURE__ */ u("option", { value: e }, e))
287
+ children: oe.map((e) => /* @__PURE__ */ u("option", { value: e }, e))
202
288
  })
203
289
  ]
204
290
  }), /* @__PURE__ */ d("div", {
205
291
  className: "space-y-2",
206
- children: [/* @__PURE__ */ u(S, {
292
+ children: [/* @__PURE__ */ u(x, {
207
293
  htmlFor: "job-experience",
294
+ required: !0,
208
295
  children: "Experience Level"
209
296
  }), /* @__PURE__ */ u("select", {
210
297
  id: "job-experience",
211
298
  className: v,
212
- value: I,
213
- onChange: (e) => L(e.target.value),
214
- children: x.map((e) => /* @__PURE__ */ u("option", {
299
+ value: F,
300
+ onChange: (e) => I(e.target.value),
301
+ children: re.map((e) => /* @__PURE__ */ u("option", {
215
302
  value: e.value,
216
303
  children: e.label
217
304
  }, e.value))
@@ -222,54 +309,88 @@ function C() {
222
309
  className: "grid grid-cols-1 gap-5 md:grid-cols-2",
223
310
  children: [/* @__PURE__ */ d("div", {
224
311
  className: "space-y-2",
225
- children: [/* @__PURE__ */ u(S, {
226
- htmlFor: "job-location",
227
- children: "Location"
228
- }), /* @__PURE__ */ u(m, {
229
- id: "job-location",
230
- placeholder: "e.g. San Francisco, CA",
231
- value: j,
232
- onChange: (e) => te(e.target.value)
233
- })]
312
+ children: [
313
+ /* @__PURE__ */ u(x, {
314
+ htmlFor: "job-location",
315
+ required: !0,
316
+ children: "Location"
317
+ }),
318
+ /* @__PURE__ */ u(h, {
319
+ id: "job-location",
320
+ placeholder: "e.g. San Francisco, CA",
321
+ value: A,
322
+ "aria-invalid": !!Y.location || void 0,
323
+ "aria-describedby": Y.location ? "job-location-error" : void 0,
324
+ onChange: (e) => {
325
+ j(e.target.value), Z("location");
326
+ }
327
+ }),
328
+ Y.location ? /* @__PURE__ */ u(S, {
329
+ id: "job-location-error",
330
+ message: Y.location
331
+ }) : null
332
+ ]
234
333
  }), /* @__PURE__ */ d("div", {
235
334
  className: "grid grid-cols-2 gap-4",
236
335
  children: [/* @__PURE__ */ d("div", {
237
336
  className: "space-y-2",
238
- children: [/* @__PURE__ */ u(S, {
337
+ children: [/* @__PURE__ */ u(x, {
239
338
  htmlFor: "job-salary-min",
240
339
  children: "Salary Min"
241
340
  }), /* @__PURE__ */ d("div", {
242
341
  className: "relative",
243
- children: [/* @__PURE__ */ u("span", {
244
- className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
245
- children: "$"
246
- }), /* @__PURE__ */ u(m, {
247
- id: "job-salary-min",
248
- type: "number",
249
- className: "pl-7",
250
- placeholder: "120,000",
251
- value: R,
252
- onChange: (e) => z(e.target.value)
253
- })]
342
+ children: [
343
+ /* @__PURE__ */ u("span", {
344
+ className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
345
+ children: "$"
346
+ }),
347
+ /* @__PURE__ */ u(h, {
348
+ id: "job-salary-min",
349
+ type: "number",
350
+ "aria-invalid": !!Y.salaryMin || void 0,
351
+ "aria-describedby": Y.salaryMin ? "job-salary-min-error" : void 0,
352
+ className: "pl-7",
353
+ placeholder: "120,000",
354
+ value: L,
355
+ onChange: (e) => {
356
+ R(e.target.value), Z("salaryMin"), Z("salaryMax");
357
+ }
358
+ }),
359
+ Y.salaryMin ? /* @__PURE__ */ u(S, {
360
+ id: "job-salary-min-error",
361
+ message: Y.salaryMin
362
+ }) : null
363
+ ]
254
364
  })]
255
365
  }), /* @__PURE__ */ d("div", {
256
366
  className: "space-y-2",
257
- children: [/* @__PURE__ */ u(S, {
367
+ children: [/* @__PURE__ */ u(x, {
258
368
  htmlFor: "job-salary-max",
259
369
  children: "Salary Max"
260
370
  }), /* @__PURE__ */ d("div", {
261
371
  className: "relative",
262
- children: [/* @__PURE__ */ u("span", {
263
- className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
264
- children: "$"
265
- }), /* @__PURE__ */ u(m, {
266
- id: "job-salary-max",
267
- type: "number",
268
- className: "pl-7",
269
- placeholder: "180,000",
270
- value: B,
271
- onChange: (e) => V(e.target.value)
272
- })]
372
+ children: [
373
+ /* @__PURE__ */ u("span", {
374
+ className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
375
+ children: "$"
376
+ }),
377
+ /* @__PURE__ */ u(h, {
378
+ id: "job-salary-max",
379
+ type: "number",
380
+ "aria-invalid": !!Y.salaryMax || void 0,
381
+ "aria-describedby": Y.salaryMax ? "job-salary-max-error" : void 0,
382
+ className: "pl-7",
383
+ placeholder: "180,000",
384
+ value: z,
385
+ onChange: (e) => {
386
+ B(e.target.value), Z("salaryMax"), Z("salaryMin");
387
+ }
388
+ }),
389
+ Y.salaryMax ? /* @__PURE__ */ u(S, {
390
+ id: "job-salary-max-error",
391
+ message: Y.salaryMax
392
+ }) : null
393
+ ]
273
394
  })]
274
395
  })]
275
396
  })]
@@ -278,29 +399,53 @@ function C() {
278
399
  className: "grid grid-cols-1 gap-5 md:grid-cols-2",
279
400
  children: /* @__PURE__ */ d("div", {
280
401
  className: "space-y-2",
281
- children: [/* @__PURE__ */ u(S, {
282
- htmlFor: "job-deadline",
283
- children: "Application Deadline"
284
- }), /* @__PURE__ */ u(m, {
285
- id: "job-deadline",
286
- type: "date",
287
- value: H,
288
- onChange: (e) => U(e.target.value)
289
- })]
402
+ children: [
403
+ /* @__PURE__ */ u(x, {
404
+ htmlFor: "job-deadline",
405
+ children: "Application Deadline"
406
+ }),
407
+ /* @__PURE__ */ u(h, {
408
+ id: "job-deadline",
409
+ type: "date",
410
+ min: ae,
411
+ value: V,
412
+ "aria-invalid": !!Y.deadline || void 0,
413
+ "aria-describedby": Y.deadline ? "job-deadline-error" : void 0,
414
+ onChange: (e) => {
415
+ H(e.target.value), Z("deadline");
416
+ }
417
+ }),
418
+ Y.deadline ? /* @__PURE__ */ u(S, {
419
+ id: "job-deadline-error",
420
+ message: Y.deadline
421
+ }) : null
422
+ ]
290
423
  })
291
424
  }),
292
425
  /* @__PURE__ */ d("div", {
293
426
  className: "space-y-2",
294
- children: [/* @__PURE__ */ u(S, {
295
- htmlFor: "job-description",
296
- children: "Description"
297
- }), /* @__PURE__ */ u(g, {
298
- id: "job-description",
299
- placeholder: "Describe the role, responsibilities, and ideal candidate...",
300
- rows: 4,
301
- value: M,
302
- onChange: (e) => N(e.target.value)
303
- })]
427
+ children: [
428
+ /* @__PURE__ */ u(x, {
429
+ htmlFor: "job-description",
430
+ required: !0,
431
+ children: "Description"
432
+ }),
433
+ /* @__PURE__ */ u(g, {
434
+ id: "job-description",
435
+ placeholder: "Describe the role, responsibilities, and ideal candidate...",
436
+ rows: 4,
437
+ value: M,
438
+ "aria-invalid": !!Y.description || void 0,
439
+ "aria-describedby": Y.description ? "job-description-error" : void 0,
440
+ onChange: (e) => {
441
+ N(e.target.value), Z("description");
442
+ }
443
+ }),
444
+ Y.description ? /* @__PURE__ */ u(S, {
445
+ id: "job-description-error",
446
+ message: Y.description
447
+ }) : null
448
+ ]
304
449
  }),
305
450
  /* @__PURE__ */ d("div", {
306
451
  className: "grid grid-cols-1 gap-6 border-t border-border-subtle pt-5 md:grid-cols-2",
@@ -312,7 +457,7 @@ function C() {
312
457
  }), /* @__PURE__ */ u("p", {
313
458
  className: "text-xs text-text-secondary",
314
459
  children: "List the key requirements for this role"
315
- })] }), $(W, re, ae, Z, "Requirement", "e.g. 5+ years with React")]
460
+ })] }), $(U, le, de, se, "Requirement", "e.g. 5+ years with React")]
316
461
  }), /* @__PURE__ */ d("div", {
317
462
  className: "space-y-3",
318
463
  children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
@@ -321,20 +466,20 @@ function C() {
321
466
  }), /* @__PURE__ */ u("p", {
322
467
  className: "text-xs text-text-secondary",
323
468
  children: "What does this position offer?"
324
- })] }), $(K, ie, oe, ne, "Benefit", "e.g. Flexible remote work")]
469
+ })] }), $(G, ue, fe, ce, "Benefit", "e.g. Flexible remote work")]
325
470
  })]
326
471
  }),
327
472
  /* @__PURE__ */ d("div", {
328
473
  className: "flex flex-col-reverse justify-end gap-2 border-t border-border-subtle pt-5 sm:flex-row",
329
474
  children: [/* @__PURE__ */ u(f, {
330
475
  variant: "outline",
331
- disabled: J,
476
+ disabled: q,
332
477
  onClick: () => Q("draft"),
333
478
  children: "Save as Draft"
334
479
  }), /* @__PURE__ */ d(f, {
335
- disabled: J,
480
+ disabled: q,
336
481
  onClick: () => Q("active"),
337
- children: [/* @__PURE__ */ u(s, { className: "h-4 w-4 mr-1" }), J ? "Saving…" : "Publish Job"]
482
+ children: [/* @__PURE__ */ u(l, { className: "h-4 w-4 mr-1" }), q ? "Saving…" : "Publish Job"]
338
483
  })]
339
484
  })
340
485
  ]