@recruitnepal/shared-packages 1.8.6 → 1.8.8
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.
- package/dist/api-client.d.ts +0 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +0 -1
- package/dist/components/JobCard/FallbackImage.d.ts +12 -0
- package/dist/components/JobCard/FallbackImage.d.ts.map +1 -0
- package/dist/components/JobCard/FallbackImage.js +20 -0
- package/dist/components/JobCard/JobCard.d.ts +13 -0
- package/dist/components/JobCard/JobCard.d.ts.map +1 -0
- package/dist/components/JobCard/JobCard.js +27 -0
- package/dist/components/ui/Badge.d.ts +1 -1
- package/dist/components/ui/Badge.d.ts.map +1 -1
- package/dist/components/ui/Badge.js +4 -2
- package/dist/hooks/useGetAllVacancy.d.ts +1 -1
- package/dist/hooks/useGetAllVacancy.d.ts.map +1 -1
- package/dist/hooks/useGetAllVacancy.js +8 -6
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/types/job-card.d.ts +18 -0
- package/dist/types/job-card.d.ts.map +1 -0
- package/dist/types/job-card.js +1 -0
- package/dist/utils/capitalize.d.ts +2 -0
- package/dist/utils/capitalize.d.ts.map +1 -0
- package/dist/utils/capitalize.js +5 -0
- package/dist/utils/formatEmploymentType.d.ts +3 -0
- package/dist/utils/formatEmploymentType.d.ts.map +1 -0
- package/dist/utils/formatEmploymentType.js +8 -0
- package/dist/utils/formatSalaryRange.d.ts +3 -0
- package/dist/utils/formatSalaryRange.d.ts.map +1 -0
- package/dist/utils/formatSalaryRange.js +47 -0
- package/package.json +1 -1
package/dist/api-client.d.ts
CHANGED
package/dist/api-client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,QAElD;AAED,wBAAgB,UAAU,WAKzB;AAED,eAAO,MAAM,GAAG;;;mBAGD,MAAM
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,QAElD;AAED,wBAAgB,UAAU,WAKzB;AAED,eAAO,MAAM,GAAG;;;mBAGD,MAAM;;;sBAGH,MAAM;;qBAEP,MAAM;;;sBAGL,MAAM;;qBAEP,MAAM;qBACN,MAAM;;;;iCAIM,MAAM;;;;;;qCAMF,MAAM;+CACI,MAAM;;CAEhD,CAAC"}
|
package/dist/api-client.js
CHANGED
|
@@ -12,7 +12,6 @@ export const API = {
|
|
|
12
12
|
vacancies: {
|
|
13
13
|
list: () => `${getBaseURL()}/vacancies`,
|
|
14
14
|
byId: (id) => `${getBaseURL()}/vacancies/${id}`,
|
|
15
|
-
intern: () => `${getBaseURL()}/intern/vacancies`,
|
|
16
15
|
},
|
|
17
16
|
savedVacancies: {
|
|
18
17
|
list: (page) => `${getBaseURL()}/saved/vacancies${page ? `?page=${page}` : ''}`,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FallbackImageProps = {
|
|
2
|
+
src?: string | null;
|
|
3
|
+
alt?: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
fallbackText?: string;
|
|
8
|
+
fallbackClassName?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function FallbackImage({ src, alt, width, height, className, fallbackText, fallbackClassName, }: FallbackImageProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=FallbackImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FallbackImage.d.ts","sourceRoot":"","sources":["../../../src/components/JobCard/FallbackImage.tsx"],"names":[],"mappings":"AAKA,KAAK,kBAAkB,GAAG;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,GAAoB,EACpB,KAAU,EACV,MAAW,EACX,SAAS,EACT,YAAY,EACZ,iBAAiB,GAClB,EAAE,kBAAkB,2CAiDpB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { cn } from '../../utils/cn';
|
|
5
|
+
export function FallbackImage({ src, alt = 'Company Logo', width = 62, height = 62, className, fallbackText, fallbackClassName, }) {
|
|
6
|
+
const [hasError, setHasError] = useState(false);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setHasError(false);
|
|
9
|
+
}, [src]);
|
|
10
|
+
const resolvedSrc = hasError || !src ? null : src;
|
|
11
|
+
const isLeadingCompany = typeof src === 'string' && src.includes('leading-company');
|
|
12
|
+
const char = isLeadingCompany ? '?' : (fallbackText?.charAt(0)?.toUpperCase() || '?');
|
|
13
|
+
if (!resolvedSrc) {
|
|
14
|
+
return (_jsx("div", { className: cn('flex items-center justify-center font-bold bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500 text-white', fallbackClassName, className), style: { width, height }, children: _jsx("span", { className: "select-none", children: char }) }));
|
|
15
|
+
}
|
|
16
|
+
if (isLeadingCompany && resolvedSrc) {
|
|
17
|
+
return (_jsx("img", { src: src, alt: alt, width: width, height: height, className: cn('object-cover', className), onError: () => setHasError(true) }));
|
|
18
|
+
}
|
|
19
|
+
return (_jsx("img", { src: resolvedSrc, alt: alt, width: width, height: height, className: cn('w-full h-full object-contain max-w-full max-h-full', className), onError: () => setHasError(true) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JobCardDetails } from '../../types/job-card';
|
|
2
|
+
export type JobCardProps = {
|
|
3
|
+
jobDetails: JobCardDetails;
|
|
4
|
+
className?: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
showDetails?: boolean;
|
|
7
|
+
hideSkills?: boolean;
|
|
8
|
+
disableHover?: boolean;
|
|
9
|
+
logoClassName?: string;
|
|
10
|
+
logoWrapperClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function JobCard({ jobDetails, className, onClick, showDetails, hideSkills, disableHover, logoClassName, logoWrapperClassName, }: JobCardProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=JobCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JobCard.d.ts","sourceRoot":"","sources":["../../../src/components/JobCard/JobCard.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAkB,EAClB,UAAkB,EAClB,YAAoB,EACpB,aAAa,EACb,oBAAoB,GACrB,EAAE,YAAY,2CA+Fd"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { Banknote, BriefcaseBusiness, MapPin } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../utils/cn';
|
|
6
|
+
import { formatSalaryRange } from '../../utils/formatSalaryRange';
|
|
7
|
+
import { formatEmploymentTypes } from '../../utils/formatEmploymentType';
|
|
8
|
+
import { capitalize } from '../../utils/capitalize';
|
|
9
|
+
import { FallbackImage } from './FallbackImage';
|
|
10
|
+
import { Badge } from '../ui/Badge';
|
|
11
|
+
export function JobCard({ jobDetails, className, onClick, showDetails = true, hideSkills = false, disableHover = false, logoClassName, logoWrapperClassName, }) {
|
|
12
|
+
const jobTypeRef = useRef(jobDetails.jobType);
|
|
13
|
+
if (jobTypeRef.current !== jobDetails.jobType) {
|
|
14
|
+
jobTypeRef.current = jobDetails.jobType;
|
|
15
|
+
}
|
|
16
|
+
const salaryText = typeof jobDetails.salaryRange === 'string'
|
|
17
|
+
? jobDetails.salaryRange
|
|
18
|
+
: jobDetails.salaryRange
|
|
19
|
+
? formatSalaryRange(jobDetails.salaryRange)
|
|
20
|
+
: 'Not Disclosed';
|
|
21
|
+
const normalizedJobTypeArray = Array.isArray(jobDetails.jobType)
|
|
22
|
+
? jobDetails.jobType
|
|
23
|
+
: jobDetails.jobType
|
|
24
|
+
? [jobDetails.jobType]
|
|
25
|
+
: [];
|
|
26
|
+
return (_jsxs("div", { className: cn('rounded-xl sm:rounded-3xl cursor-pointer', !disableHover && 'hover:shadow-md', className), onClick: onClick, children: [_jsxs("div", { className: "flex gap-2 items-center", children: [_jsx("div", { className: cn('w-14 h-14 border bg-white rounded-xl overflow-hidden flex items-center justify-center shrink-0', logoWrapperClassName), children: _jsx(FallbackImage, { src: jobDetails.companyLogo || null, alt: "Company Logo", width: 62, height: 62, className: cn('w-full h-full object-contain max-w-full max-h-full', logoClassName), fallbackText: jobDetails.hideCompanyName ? undefined : jobDetails.companyName?.charAt(0)?.toUpperCase(), fallbackClassName: "w-full h-full rounded-xl text-xl" }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-md font-semibold text-text-primary", children: jobDetails.jobTitle }), _jsx("p", { className: "text-sm text-text-secondary", children: jobDetails.companyName })] })] }), showDetails && (_jsxs("div", { className: "mt-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-text-secondary mb-2", children: [jobDetails.location && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(MapPin, { size: 14, className: "min-w-[14px]" }), capitalize(jobDetails.location)] })), normalizedJobTypeArray.length > 0 && (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(BriefcaseBusiness, { size: 14, className: "min-w-[14px]" }), formatEmploymentTypes(normalizedJobTypeArray)] })), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Banknote, { size: 14, className: "min-w-[14px]" }), capitalize(salaryText)] })] }), !hideSkills && jobDetails.skills && jobDetails.skills.length > 0 && (_jsx("div", { className: "flex items-center gap-3 flex-wrap mb-1", children: jobDetails.skills.slice(0, 3).map((skill, index) => (_jsx(Badge, { className: "py-1 px-3 text-xs bg-secondary border border-black/10 shrink-0", children: skill }, index))) }))] }))] }));
|
|
27
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "outline" | "secondary" | "default" | null | undefined;
|
|
4
|
+
variant?: "success" | "outline" | "secondary" | "default" | "destructive" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAE1D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -5,8 +5,10 @@ import { cn } from '../../utils/cn';
|
|
|
5
5
|
const badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-1.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
|
-
default: 'border-transparent bg-primary/40 text-primary
|
|
8
|
+
default: 'border-transparent bg-primary/40 text-text-primary',
|
|
9
|
+
success: 'border-transparent bg-success text-success-foreground',
|
|
9
10
|
secondary: 'border-transparent bg-secondary text-secondary-foreground',
|
|
11
|
+
destructive: 'border-transparent bg-destructive text-destructive-foreground',
|
|
10
12
|
outline: 'text-foreground',
|
|
11
13
|
},
|
|
12
14
|
},
|
|
@@ -15,6 +17,6 @@ const badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 p
|
|
|
15
17
|
},
|
|
16
18
|
});
|
|
17
19
|
function Badge({ className, variant, ...props }) {
|
|
18
|
-
return
|
|
20
|
+
return _jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
19
21
|
}
|
|
20
22
|
export { Badge, badgeVariants };
|
|
@@ -7,7 +7,7 @@ type Config = {
|
|
|
7
7
|
limit?: number;
|
|
8
8
|
companyId?: string;
|
|
9
9
|
forceStatus?: string;
|
|
10
|
-
/** When true,
|
|
10
|
+
/** When true, adds type=intern to query (for Intern Nepal: vacancies?type=intern) */
|
|
11
11
|
isIntern?: boolean;
|
|
12
12
|
/** Optional token for authenticated requests */
|
|
13
13
|
token?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetAllVacancy.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllVacancy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAiB,gBAAgB,EAAc,MAAM,UAAU,CAAC;AAE5E,KAAK,IAAI,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5B,KAAK,MAAM,GAAG;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"useGetAllVacancy.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetAllVacancy.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAiB,gBAAgB,EAAc,MAAM,UAAU,CAAC;AAE5E,KAAK,IAAI,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5B,KAAK,MAAM,GAAG;IACZ,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,YAAY,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAkBF,eAAO,MAAM,gBAAgB,GAAI,mHAU9B,MAAW;;;;;;;;;;iBAnBD,MAAM;kBACL,MAAM;kBACN,MAAM;kBACN,MAAM;iBACP,MAAM;cACT,MAAM;;CAiOf,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -17,6 +17,7 @@ export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit
|
|
|
17
17
|
const statusParam = forceStatus ?? searchParams?.get('status') ?? '';
|
|
18
18
|
const status = statusParam === 'all' ? '' : statusParam;
|
|
19
19
|
const sortBy = searchParams?.get('sort') || '';
|
|
20
|
+
const typeParam = isIntern ? 'intern' : (searchParams?.get('type') || '');
|
|
20
21
|
const buildUnified = (pg, fallbackTotal = 0) => {
|
|
21
22
|
const p = pg?.page ?? 1;
|
|
22
23
|
const ps = pg?.pages ?? 1;
|
|
@@ -30,7 +31,7 @@ export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit
|
|
|
30
31
|
prevPage: pv,
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
|
-
// Helper to build clean query string
|
|
34
|
+
// Helper to build clean query string (always uses /vacancies; type=intern when isIntern)
|
|
34
35
|
const buildQueryString = (pageNum, pageLimit) => {
|
|
35
36
|
const params = new URLSearchParams();
|
|
36
37
|
params.set('page', String(pageNum));
|
|
@@ -45,19 +46,20 @@ export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit
|
|
|
45
46
|
params.set('companyId', companyIdParam);
|
|
46
47
|
if (status)
|
|
47
48
|
params.set('status', status);
|
|
49
|
+
if (typeParam)
|
|
50
|
+
params.set('type', typeParam);
|
|
48
51
|
if (sortBy) {
|
|
49
52
|
params.set('sortBy', 'created_at');
|
|
50
53
|
params.set('sortOrder', sortBy);
|
|
51
54
|
}
|
|
52
55
|
return params.toString();
|
|
53
56
|
};
|
|
54
|
-
const listBasePath = isIntern ? '/intern/vacancies' : '/vacancies';
|
|
55
57
|
const fetchPaged = async () => {
|
|
56
58
|
const p = page ?? 1;
|
|
57
59
|
const l = String(limit ?? urlLimit);
|
|
58
60
|
const queryString = buildQueryString(p, l);
|
|
59
61
|
const res = await apiRequest({
|
|
60
|
-
endpoint:
|
|
62
|
+
endpoint: `/vacancies?${queryString}&_t=${Date.now()}`,
|
|
61
63
|
method: 'GET',
|
|
62
64
|
token: publicFetch ? undefined : token,
|
|
63
65
|
});
|
|
@@ -96,7 +98,7 @@ export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit
|
|
|
96
98
|
while (next) {
|
|
97
99
|
const queryString = buildQueryString(next, l);
|
|
98
100
|
const res = await apiRequest({
|
|
99
|
-
endpoint:
|
|
101
|
+
endpoint: `/vacancies?${queryString}`,
|
|
100
102
|
method: 'GET',
|
|
101
103
|
token: publicFetch ? undefined : token,
|
|
102
104
|
});
|
|
@@ -129,7 +131,7 @@ export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit
|
|
|
129
131
|
const effectiveLimit = limit ?? urlLimit;
|
|
130
132
|
const rq = useQuery({
|
|
131
133
|
queryKey: [
|
|
132
|
-
|
|
134
|
+
'vacancies',
|
|
133
135
|
mode,
|
|
134
136
|
page ?? null,
|
|
135
137
|
effectiveLimit,
|
|
@@ -139,9 +141,9 @@ export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit
|
|
|
139
141
|
companyIdParam,
|
|
140
142
|
statusParam,
|
|
141
143
|
sortBy,
|
|
144
|
+
typeParam,
|
|
142
145
|
publicFetch ? 'pub' : 'auth',
|
|
143
146
|
token ?? 'no-token',
|
|
144
|
-
isIntern,
|
|
145
147
|
],
|
|
146
148
|
queryFn: mode === 'paged' ? fetchPaged : fetchAll,
|
|
147
149
|
enabled: isReady,
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,14 @@ export type { Question, AnswerOption, VacancyQuestionsResponse, } from './types/
|
|
|
6
6
|
export { WORKSTATUS, WORK_STATUS_VALUES, } from './types/easy-apply';
|
|
7
7
|
export type { WorkStatusValue, QuestionsAPIRes, ScreeningAnswersApiResNew, } from './types/easy-apply';
|
|
8
8
|
export type { VacancyCategory, VacancyCategoryAPIRes } from './types/vacancy-category';
|
|
9
|
+
export type { SalaryRangeItem, JobCardDetails } from './types/job-card';
|
|
9
10
|
export { apiRequest } from './utils/api-request';
|
|
10
11
|
export type { ApiResponse } from './utils/api-request';
|
|
11
12
|
export { cn } from './utils/cn';
|
|
12
13
|
export { generateSearchQuery } from './utils/generateSearchQuery';
|
|
14
|
+
export { formatSalaryRange } from './utils/formatSalaryRange';
|
|
15
|
+
export { formatEmploymentType, formatEmploymentTypes } from './utils/formatEmploymentType';
|
|
16
|
+
export { capitalize } from './utils/capitalize';
|
|
13
17
|
export { useDebounce } from './hooks/useDebounce';
|
|
14
18
|
export { useIndustries } from './hooks/useIndustries';
|
|
15
19
|
export type { Industry, IndustryPayload, UseIndustriesParams } from './hooks/useIndustries';
|
|
@@ -45,5 +49,9 @@ export type { MultiSelectOptionsProps } from './components/ui/MultiSelectOptions
|
|
|
45
49
|
export { Input } from './components/ui/Input';
|
|
46
50
|
export type { InputProps } from './components/ui/Input';
|
|
47
51
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, } from './components/ui/Dialog';
|
|
52
|
+
export { Badge, badgeVariants } from './components/ui/Badge';
|
|
53
|
+
export type { BadgeProps } from './components/ui/Badge';
|
|
54
|
+
export { JobCard } from './components/JobCard/JobCard';
|
|
55
|
+
export type { JobCardProps } from './components/JobCard/JobCard';
|
|
48
56
|
export * from './career-personality-test';
|
|
49
57
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxD,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,UAAU,EACV,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,eAAe,EACf,eAAe,EACf,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxD,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,gBAAg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M,4BAA4B,CAAC;AAG1F,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,YAAY,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGjE,cAAc,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,9 @@ export { WORKSTATUS, WORK_STATUS_VALUES, } from './types/easy-apply';
|
|
|
5
5
|
export { apiRequest } from './utils/api-request';
|
|
6
6
|
export { cn } from './utils/cn';
|
|
7
7
|
export { generateSearchQuery } from './utils/generateSearchQuery';
|
|
8
|
+
export { formatSalaryRange } from './utils/formatSalaryRange';
|
|
9
|
+
export { formatEmploymentType, formatEmploymentTypes } from './utils/formatEmploymentType';
|
|
10
|
+
export { capitalize } from './utils/capitalize';
|
|
8
11
|
// Hooks (debounce + industry/designation/skill API)
|
|
9
12
|
export { useDebounce } from './hooks/useDebounce';
|
|
10
13
|
export { useIndustries } from './hooks/useIndustries';
|
|
@@ -33,5 +36,7 @@ export { default as DesignationSelect } from './components/ui/DesignationSelect'
|
|
|
33
36
|
export { MultiSelectOptions } from './components/ui/MultiSelectOptions';
|
|
34
37
|
export { Input } from './components/ui/Input';
|
|
35
38
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, } from './components/ui/Dialog';
|
|
39
|
+
export { Badge, badgeVariants } from './components/ui/Badge';
|
|
40
|
+
export { JobCard } from './components/JobCard/JobCard';
|
|
36
41
|
// Career Personality Test
|
|
37
42
|
export * from './career-personality-test';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Used by JobCard for salary display */
|
|
2
|
+
export type SalaryRangeItem = {
|
|
3
|
+
value: number;
|
|
4
|
+
inclusive?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type JobCardDetails = {
|
|
7
|
+
id: string | number;
|
|
8
|
+
slug: string;
|
|
9
|
+
companyLogo: string;
|
|
10
|
+
jobTitle: string;
|
|
11
|
+
companyName: string;
|
|
12
|
+
location: string;
|
|
13
|
+
jobType: string | string[];
|
|
14
|
+
salaryRange?: string | SalaryRangeItem[];
|
|
15
|
+
skills?: string[];
|
|
16
|
+
hideCompanyName?: boolean;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=job-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-card.d.ts","sourceRoot":"","sources":["../../src/types/job-card.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,eAAe,EAAE,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capitalize.d.ts","sourceRoot":"","sources":["../../src/utils/capitalize.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatEmploymentType.d.ts","sourceRoot":"","sources":["../../src/utils/formatEmploymentType.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGhF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function formatEmploymentType(type) {
|
|
2
|
+
return type.replace(/_/g, ' ').replace(/\b\w/g, (char) => char.toUpperCase());
|
|
3
|
+
}
|
|
4
|
+
export function formatEmploymentTypes(types) {
|
|
5
|
+
if (!types || types.length === 0)
|
|
6
|
+
return 'Not Specified';
|
|
7
|
+
return types.map(formatEmploymentType).join(', ');
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatSalaryRange.d.ts","sourceRoot":"","sources":["../../src/utils/formatSalaryRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,IAAI,GAAG,SAAS,GACnD,MAAM,CA6CR"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function formatSalaryRange(range) {
|
|
2
|
+
if (!range || (Array.isArray(range) && range.length === 0))
|
|
3
|
+
return 'Negotiable';
|
|
4
|
+
if (Array.isArray(range)) {
|
|
5
|
+
const min = range[0]?.value;
|
|
6
|
+
const max = range[1]?.value;
|
|
7
|
+
if (typeof min === 'number' && typeof max === 'number') {
|
|
8
|
+
return `NRS. ${Math.floor(min / 1000)}K - ${Math.floor(max / 1000)}K`;
|
|
9
|
+
}
|
|
10
|
+
if (typeof min === 'number')
|
|
11
|
+
return `From NRS. ${Math.floor(min / 1000)}K`;
|
|
12
|
+
if (typeof max === 'number')
|
|
13
|
+
return `Up to NRS. ${Math.floor(max / 1000)}K`;
|
|
14
|
+
return 'Negotiable';
|
|
15
|
+
}
|
|
16
|
+
if (typeof range === 'string') {
|
|
17
|
+
const normalized = range.trim().toLowerCase();
|
|
18
|
+
if (normalized === 'negotiable' || normalized === 'salary negotiable' || normalized.includes('negotiable')) {
|
|
19
|
+
return 'Negotiable';
|
|
20
|
+
}
|
|
21
|
+
const postgresMatch = range.match(/\[?(\d+)[,\s]+(\d+)\]?/);
|
|
22
|
+
if (postgresMatch) {
|
|
23
|
+
const [, minStr, maxStr] = postgresMatch;
|
|
24
|
+
const min = parseInt(minStr, 10);
|
|
25
|
+
const max = parseInt(maxStr, 10);
|
|
26
|
+
if (!isNaN(min) && !isNaN(max)) {
|
|
27
|
+
return `NRS. ${Math.floor(min / 1000)}K - ${Math.floor(max / 1000)}K`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const splitMatch = range.split('-');
|
|
31
|
+
if (splitMatch.length === 2) {
|
|
32
|
+
const min = parseInt(splitMatch[0].trim(), 10);
|
|
33
|
+
const max = parseInt(splitMatch[1].trim(), 10);
|
|
34
|
+
if (!isNaN(min) && !isNaN(max)) {
|
|
35
|
+
return `NRS. ${Math.floor(min / 1000)}K - ${Math.floor(max / 1000)}K`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const singleNumberMatch = range.match(/^\d+$/);
|
|
39
|
+
if (singleNumberMatch) {
|
|
40
|
+
const value = parseInt(singleNumberMatch[0], 10);
|
|
41
|
+
if (!isNaN(value))
|
|
42
|
+
return `From NRS. ${Math.floor(value / 1000)}K`;
|
|
43
|
+
}
|
|
44
|
+
return 'Negotiable';
|
|
45
|
+
}
|
|
46
|
+
return 'Negotiable';
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recruitnepal/shared-packages",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.8",
|
|
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",
|