@recruitnepal/shared-packages 1.8.1 → 1.8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"CareerTestDetailsForm.d.ts","sourceRoot":"","sources":["../../../src/career-personality-test/components/CareerTestDetailsForm.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC5F,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAgBF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAqC,GACtC,EAAE,0BAA0B,2CAoJ5B"}
1
+ {"version":3,"file":"CareerTestDetailsForm.d.ts","sourceRoot":"","sources":["../../../src/career-personality-test/components/CareerTestDetailsForm.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAC5F,qDAAqD;IACrD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAgBF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,cAAqC,GACtC,EAAE,0BAA0B,2CAqJ5B"}
@@ -87,5 +87,5 @@ export function CareerTestDetailsForm({ basePath, navigate, getInitialData, onSu
87
87
  setSubmitting(false);
88
88
  navigate(`${basePath}/start`);
89
89
  };
90
- return (_jsx("main", { className: "container mx-auto px-4 md:px-6 py-10 md:py-14", children: _jsxs("div", { className: "mx-auto max-w-3xl rounded-2xl border shadow-sm bg-white p-6 md:p-10 relative", children: [_jsx("div", { className: "pointer-events-none absolute inset-0 rounded-2xl ring-2 ring-[#4DA0E6]/80" }), _jsx("h1", { className: "text-center text-3xl md:text-4xl font-semibold text-[#2E7DBE]", children: "Let's Get Started" }), _jsxs("p", { className: "mt-2 text-center text-sm text-slate-600", children: ["We'll use this to personalize your report and show", _jsx("br", { className: "hidden md:block" }), " your name on the results page."] }), _jsxs("form", { onSubmit: handleSubmit, className: "mt-8 space-y-5", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "First Name" }), _jsx("input", { type: "text", value: firstName, onChange: (e) => setFirstName(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.firstName ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), maxLength: 50, autoComplete: "given-name" }), errors.firstName && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.firstName })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Last Name" }), _jsx("input", { type: "text", value: lastName, onChange: (e) => setLastName(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.lastName ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), maxLength: 50, autoComplete: "family-name" }), errors.lastName && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.lastName })] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Email" }), _jsx("input", { type: "email", value: email, onChange: (e) => setEmail(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.email ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), autoComplete: "email" }), errors.email && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.email })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Phone Number" }), _jsx("input", { type: "tel", value: phone, onChange: (e) => setPhone(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.phone ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), placeholder: "Optional", autoComplete: "tel" }), errors.phone && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.phone })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Education Level" }), _jsxs("select", { value: education, onChange: (e) => setEducation(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.education ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), children: [_jsx("option", { value: "", children: "Select education level" }), EDUCATION_OPTIONS.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value)))] }), errors.education && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.education })] }), _jsx("p", { className: "text-center text-[11px] text-slate-500", children: "We won't share your details with employers without your permission." }), _jsx("div", { className: "flex justify-center pt-1", children: _jsx("button", { type: "submit", disabled: submitting, className: cn('w-full md:w-[280px] rounded-lg bg-[#4D97D9] px-5 py-3 text-white text-base font-semibold shadow-sm', submitting && 'opacity-70 cursor-not-allowed'), children: submitting ? 'Please wait…' : 'Start the Test' }) }), errors.form && _jsx("p", { className: "text-center text-sm text-red-500 mt-2", children: errors.form })] })] }) }));
90
+ return (_jsx("main", { className: "container mx-auto px-4 md:px-6 py-10 md:py-14", children: _jsxs("div", { className: "mx-auto max-w-3xl rounded-2xl border shadow-sm bg-white p-6 md:p-10 relative", children: [_jsx("div", { className: "pointer-events-none absolute inset-0 rounded-2xl ring-2 ring-[#4DA0E6]/80" }), _jsx("h1", { className: "text-center text-3xl md:text-4xl font-semibold text-[#2E7DBE]", children: "Let's Get Started" }), _jsxs("p", { className: "mt-2 text-center text-sm text-slate-600", children: ["We'll use this to personalize your report and show", _jsx("br", { className: "hidden md:block" }), " your name on the results page."] }), _jsxs("form", { onSubmit: handleSubmit, className: "mt-8 space-y-5", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "First Name" }), _jsx("input", { type: "text", value: firstName, onChange: (e) => setFirstName(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.firstName ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), maxLength: 50, autoComplete: "given-name" }), errors.firstName && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.firstName })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Last Name" }), _jsx("input", { type: "text", value: lastName, onChange: (e) => setLastName(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.lastName ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), maxLength: 50, autoComplete: "family-name" }), errors.lastName && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.lastName })] })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Email" }), _jsx("input", { type: "email", value: email, onChange: (e) => setEmail(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.email ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), autoComplete: "email" }), errors.email && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.email })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Phone Number" }), _jsx("input", { type: "tel", value: phone, onChange: (e) => setPhone(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.phone ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), placeholder: "Optional", autoComplete: "tel" }), errors.phone && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.phone })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-[12px] text-slate-600 mb-1", children: "Education Level" }), _jsxs("select", { value: education, onChange: (e) => setEducation(e.target.value), className: cn('w-full rounded-lg border px-3 py-2.5 text-sm outline-none', errors.education ? 'border-red-400 focus:ring-2 focus:ring-red-200' : 'border-slate-200 focus:ring-2 focus:ring-slate-200'), children: [_jsx("option", { value: "", children: "Select education level" }), EDUCATION_OPTIONS.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value)))] }), errors.education && _jsx("p", { className: "mt-1 text-xs text-red-500", children: errors.education })] }), _jsx("p", { className: "text-center text-[11px] text-slate-500", children: "We won't share your details with employers without your permission." }), _jsx("div", { className: "flex justify-center pt-1", children: _jsx("button", { type: "submit", disabled: submitting, className: cn('w-full md:w-[280px] rounded-lg px-5 py-3 text-base font-semibold shadow-sm', submitting && 'opacity-70 cursor-not-allowed'), style: { backgroundColor: '#4D97D9', color: 'white' }, children: submitting ? 'Please wait…' : 'Start the Test' }) }), errors.form && _jsx("p", { className: "text-center text-sm text-red-500 mt-2", children: errors.form })] })] }) }));
91
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CareerTestStart.d.ts","sourceRoot":"","sources":["../../../src/career-personality-test/components/CareerTestStart.tsx"],"names":[],"mappings":"AA4BA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAsDF,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAA2C,EAAE,EAAE,oBAAoB,2CAmGxH"}
1
+ {"version":3,"file":"CareerTestStart.d.ts","sourceRoot":"","sources":["../../../src/career-personality-test/components/CareerTestStart.tsx"],"names":[],"mappings":"AA4BA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAkEF,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAA2C,EAAE,EAAE,oBAAoB,2CAmGxH"}
@@ -10,11 +10,11 @@ import { QUESTIONS } from '../data/questions';
10
10
  const TOTAL_SECTIONS = 6;
11
11
  const NAV_OFFSET = 96;
12
12
  const SCALE = [
13
- { key: 1, label: 'Strongly\nDisagree', ring: 'ring-red-500' },
14
- { key: 2, label: 'Disagree', ring: 'ring-red-400' },
15
- { key: 3, label: 'Neutral', ring: 'ring-blue-400' },
16
- { key: 4, label: 'Agree', ring: 'ring-green-400' },
17
- { key: 5, label: 'Strongly\nAgree', ring: 'ring-green-500' },
13
+ { key: 1, label: 'Strongly\nDisagree', ringColor: '#ef4444' },
14
+ { key: 2, label: 'Disagree', ringColor: '#f87171' },
15
+ { key: 3, label: 'Neutral', ringColor: '#60a5fa' },
16
+ { key: 4, label: 'Agree', ringColor: '#4ade80' },
17
+ { key: 5, label: 'Strongly\nAgree', ringColor: '#22c55e' },
18
18
  ];
19
19
  function smoothScrollToEl(el) {
20
20
  if (!el)
@@ -23,9 +23,17 @@ function smoothScrollToEl(el) {
23
23
  window.scrollTo({ top, behavior: 'smooth' });
24
24
  }
25
25
  function QuestionRow({ q, value, onChange, setRef, }) {
26
- return (_jsxs("div", { className: "text-center", ref: setRef, children: [_jsx("h3", { className: "text-xl md:text-2xl font-semibold", children: q.prompt }), q.type === 'likert' ? (_jsx("div", { className: "mt-6 grid grid-cols-5 gap-6 md:gap-8 place-items-center", children: SCALE.map((opt) => {
26
+ return (_jsxs("div", { className: "text-center", ref: setRef, children: [_jsx("h3", { className: "text-xl md:text-2xl font-semibold", children: q.prompt }), q.type === 'likert' ? (_jsx("div", { className: "mt-6", style: {
27
+ display: 'grid',
28
+ gridTemplateColumns: 'repeat(5, 1fr)',
29
+ gap: '1.5rem',
30
+ placeItems: 'center',
31
+ }, children: SCALE.map((opt) => {
27
32
  const active = value === opt.key;
28
- return (_jsxs("button", { type: "button", onClick: () => onChange(opt.key), className: "group flex flex-col items-center gap-2 focus:outline-none", children: [_jsx("span", { className: ['h-9 w-9 rounded-full border-2 bg-white ring-2 transition', active ? 'border-current ring-current' : `border-transparent ${opt.ring}`].join(' ') }), _jsx("span", { className: "whitespace-pre-line text-[10px] text-muted-foreground text-center leading-tight", children: opt.label })] }, opt.key));
33
+ return (_jsxs("button", { type: "button", onClick: () => onChange(opt.key), className: "group flex flex-col items-center gap-2 focus:outline-none", children: [_jsx("span", { className: "h-9 w-9 rounded-full border-2 bg-white transition shrink-0", style: {
34
+ borderColor: active ? opt.ringColor : 'transparent',
35
+ boxShadow: `0 0 0 2px ${opt.ringColor}`,
36
+ } }), _jsx("span", { className: "whitespace-pre-line text-[10px] text-center leading-tight text-gray-500", children: opt.label })] }, opt.key));
29
37
  }) })) : (_jsx("div", { className: "mt-6 flex items-center justify-center gap-4", children: ['yes', 'no'].map((opt) => (_jsx(Button, { type: "button", variant: value === opt ? 'default' : 'outline', onClick: () => onChange(opt), className: "min-w-[90px]", children: opt.toUpperCase() }, opt))) }))] }));
30
38
  }
31
39
  export function CareerTestStart({ basePath, navigate, storageKeyResults = CAREER_TEST_RESULTS_KEY }) {
@@ -83,5 +91,5 @@ export function CareerTestStart({ basePath, navigate, storageKeyResults = CAREER
83
91
  }
84
92
  navigate(`${basePath}/results`);
85
93
  };
86
- return (_jsxs("main", { className: "container mx-auto px-6 py-10", children: [_jsxs("div", { className: "mx-auto max-w-3xl rounded-xl border bg-blue-50/60 p-3 shadow-sm", children: [_jsxs("div", { className: "text-[11px] font-semibold text-center text-gray-700 tracking-wide", children: ["SECTION ", section, " OF ", TOTAL_SECTIONS] }), _jsx("div", { className: "mt-2 h-1.5 w-full rounded-full bg-blue-100", children: _jsx("div", { className: "h-1.5 rounded-full bg-[#155177] transition-all", style: { width: `${progressPct}%` } }) })] }), _jsx("div", { className: "mt-10 max-w-3xl mx-auto space-y-12", children: list.map((q, idx) => (_jsx(QuestionRow, { q: q, value: answers[q.id], onChange: (val) => selectAnswer(idx, q, val), setRef: (el) => (questionRefs.current[idx] = el) }, q.id))) }), _jsxs("div", { className: "mt-12 max-w-3xl mx-auto flex items-center justify-between", children: [_jsx(Button, { variant: "outline", className: "min-w-[150px]", onClick: goPrev, disabled: section <= 1, children: "Previous Step" }), section < TOTAL_SECTIONS ? (_jsxs(Button, { className: "min-w-[150px]", onClick: goNext, children: ["Next", _jsx(ChevronRight, { className: "ml-2 h-4 w-4" })] })) : (_jsxs(Button, { className: "min-w-[170px]", onClick: seeResults, children: ["See my result", _jsx(ChevronRight, { className: "ml-2 h-4 w-4" })] }))] })] }));
94
+ return (_jsxs("main", { className: "container mx-auto px-6 py-10", children: [_jsxs("div", { className: "mx-auto max-w-3xl rounded-xl border p-3 shadow-sm", style: { backgroundColor: 'rgba(239, 246, 255, 0.6)' }, children: [_jsxs("div", { className: "text-[11px] font-semibold text-center text-gray-700 tracking-wide", children: ["SECTION ", section, " OF ", TOTAL_SECTIONS] }), _jsx("div", { className: "mt-2 h-1.5 w-full rounded-full", style: { backgroundColor: '#bfdbfe' }, children: _jsx("div", { className: "h-1.5 rounded-full transition-all", style: { width: `${progressPct}%`, backgroundColor: '#155177' } }) })] }), _jsx("div", { className: "mt-10 max-w-3xl mx-auto space-y-12", children: list.map((q, idx) => (_jsx(QuestionRow, { q: q, value: answers[q.id], onChange: (val) => selectAnswer(idx, q, val), setRef: (el) => (questionRefs.current[idx] = el) }, q.id))) }), _jsxs("div", { className: "mt-12 max-w-3xl mx-auto flex items-center justify-between", children: [_jsx(Button, { variant: "outline", className: "min-w-[150px]", onClick: goPrev, disabled: section <= 1, children: "Previous Step" }), section < TOTAL_SECTIONS ? (_jsxs(Button, { className: "min-w-[150px]", onClick: goNext, children: ["Next", _jsx(ChevronRight, { className: "ml-2 h-4 w-4" })] })) : (_jsxs(Button, { className: "min-w-[170px]", onClick: seeResults, children: ["See my result", _jsx(ChevronRight, { className: "ml-2 h-4 w-4" })] }))] })] }));
87
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recruitnepal/shared-packages",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Shared hooks, API client, types and utils for Recruit Nepal (CV builder UI and preprocess stay in each repo)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",