@recruitnepal/shared-packages 1.3.0 → 1.4.0
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/components/JobDescriptionClient.d.ts +5 -1
- package/dist/components/JobDescriptionClient.d.ts.map +1 -1
- package/dist/components/JobDescriptionClient.js +7 -5
- package/dist/components/JobsClient.d.ts +5 -1
- package/dist/components/JobsClient.d.ts.map +1 -1
- package/dist/components/JobsClient.js +33 -25
- package/dist/hooks/useGetAllVacancy.d.ts +1 -1
- package/dist/hooks/useGetAllVacancy.d.ts.map +1 -1
- package/dist/hooks/useGetAllVacancy.js +4 -8
- package/package.json +44 -45
|
@@ -43,6 +43,10 @@ export type JobDescriptionClientProps = {
|
|
|
43
43
|
onSave?: () => void;
|
|
44
44
|
onShare?: (method: 'copy' | 'whatsapp' | 'viber' | 'messenger') => void;
|
|
45
45
|
onLoginRequired?: (action: 'apply' | 'save') => void;
|
|
46
|
+
/** Optional: URL search params (e.g. from useSearchParams()). If not provided, uses window.location.search */
|
|
47
|
+
searchParams?: URLSearchParams | null;
|
|
48
|
+
/** Optional: redirect to login (e.g. router.push('/login')). If not provided, uses window.location.href = '/login' */
|
|
49
|
+
navigateToLogin?: () => void;
|
|
46
50
|
/** Utility functions */
|
|
47
51
|
capitalize?: (str: string) => string;
|
|
48
52
|
sanitizeHTML?: (html: string) => string;
|
|
@@ -55,5 +59,5 @@ export type JobDescriptionClientProps = {
|
|
|
55
59
|
chain: string;
|
|
56
60
|
};
|
|
57
61
|
};
|
|
58
|
-
export default function JobDescriptionClient({ job, slug, token, sessionStatus, personalDetailId, imageBaseURL, Button, Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Sheet, SheetContent, SheetDescription, Image, Link, LoadingButton, ScreeningQuestionsPanel, CVSelectionPanel, EasyApply, randomTraining, randomDlyticaCourse, onApply, onSave, onShare, onLoginRequired, capitalize, sanitizeHTML, extractPlainText, shareIcons, }: JobDescriptionClientProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export default function JobDescriptionClient({ job, slug, token, sessionStatus, personalDetailId, imageBaseURL, Button, Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Sheet, SheetContent, SheetDescription, Image, Link, LoadingButton, ScreeningQuestionsPanel, CVSelectionPanel, EasyApply, randomTraining, randomDlyticaCourse, onApply, onSave, onShare, onLoginRequired, capitalize, sanitizeHTML, extractPlainText, shareIcons, searchParams: searchParamsProp, navigateToLogin, }: JobDescriptionClientProps): import("react/jsx-runtime").JSX.Element;
|
|
59
63
|
//# sourceMappingURL=JobDescriptionClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobDescriptionClient.d.ts","sourceRoot":"","sources":["../../src/components/JobDescriptionClient.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JobDescriptionClient.d.ts","sourceRoot":"","sources":["../../src/components/JobDescriptionClient.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQjD,MAAM,MAAM,yBAAyB,GAAG;IACtC,GAAG,EAAE,gBAAgB,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,eAAe,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,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jE,UAAU,EACV,YAAY,EAAE,gBAAgB,EAC9B,eAAe,GAChB,EAAE,yBAAyB,2CAkd3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
|
-
import { useRouter, useSearchParams } from 'next/navigation';
|
|
5
4
|
import { useSavedVacancyMutations } from '../hooks/useSavedVacancyMutations';
|
|
6
5
|
import { useSavedVacancyList } from '../hooks/useSavedVacancyList';
|
|
7
6
|
import { useApplicantMutations } from '../hooks/useApplicantMutations';
|
|
@@ -21,9 +20,9 @@ const getSalaryText = (job) => {
|
|
|
21
20
|
}
|
|
22
21
|
return job.salary_type || 'Not Disclosed';
|
|
23
22
|
};
|
|
24
|
-
export default function JobDescriptionClient({ job, slug, token, sessionStatus = 'unauthenticated', personalDetailId, imageBaseURL = '', Button, Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Sheet, SheetContent, SheetDescription, Image, Link, LoadingButton, ScreeningQuestionsPanel, CVSelectionPanel, EasyApply, randomTraining, randomDlyticaCourse, onApply, onSave, onShare, onLoginRequired, capitalize = (str) => str, sanitizeHTML = (html) => html, extractPlainText = (html) => html.replace(/<[^>]*>/g, ''), shareIcons, }) {
|
|
25
|
-
const
|
|
26
|
-
|
|
23
|
+
export default function JobDescriptionClient({ job, slug, token, sessionStatus = 'unauthenticated', personalDetailId, imageBaseURL = '', Button, Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, Sheet, SheetContent, SheetDescription, Image, Link, LoadingButton, ScreeningQuestionsPanel, CVSelectionPanel, EasyApply, randomTraining, randomDlyticaCourse, onApply, onSave, onShare, onLoginRequired, capitalize = (str) => str, sanitizeHTML = (html) => html, extractPlainText = (html) => html.replace(/<[^>]*>/g, ''), shareIcons, searchParams: searchParamsProp, navigateToLogin, }) {
|
|
24
|
+
const searchParams = searchParamsProp ??
|
|
25
|
+
(typeof window !== 'undefined' ? new URLSearchParams(window.location.search) : new URLSearchParams());
|
|
27
26
|
const [openJobOverview, setOpenJobOverview] = useState(false);
|
|
28
27
|
const [openQuestions, setOpenQuestions] = useState(false);
|
|
29
28
|
const [isEasyApplyOpen, setIsEasyApplyOpen] = useState(false);
|
|
@@ -151,7 +150,10 @@ export default function JobDescriptionClient({ job, slug, token, sessionStatus =
|
|
|
151
150
|
const confirmLoginRedirect = () => {
|
|
152
151
|
if (pendingAction) {
|
|
153
152
|
setAuthDialogOpen(false);
|
|
154
|
-
|
|
153
|
+
if (navigateToLogin)
|
|
154
|
+
navigateToLogin();
|
|
155
|
+
else if (typeof window !== 'undefined')
|
|
156
|
+
window.location.href = '/login';
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
const companyLogoSrc = job.company_logo
|
|
@@ -10,6 +10,10 @@ export type JobsClientProps = {
|
|
|
10
10
|
initialLocation: string;
|
|
11
11
|
initialCategory: string;
|
|
12
12
|
totalJobs: number;
|
|
13
|
+
/** Optional: pass URL search params from your router (e.g. useSearchParams() in Next). If not provided, uses window.location.search */
|
|
14
|
+
searchParams?: URLSearchParams | null;
|
|
15
|
+
/** Optional: called when search changes so you can update the URL (e.g. router.push in Next). If not provided, uses history.pushState */
|
|
16
|
+
onNavigate?: (url: string) => void;
|
|
13
17
|
/** Optional header component */
|
|
14
18
|
headerComponent?: React.ComponentType<{
|
|
15
19
|
jobCount: number;
|
|
@@ -23,6 +27,6 @@ export type JobsClientProps = {
|
|
|
23
27
|
/** Optional className for the container */
|
|
24
28
|
className?: string;
|
|
25
29
|
};
|
|
26
|
-
export default function JobsClient({ initialVacancies, initialQuery, initialLocation, initialCategory, totalJobs, headerComponent: HeaderComponent, jobListingComponent: JobListingComponent, className, }: JobsClientProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export default function JobsClient({ initialVacancies, initialQuery, initialLocation, initialCategory, totalJobs, searchParams: searchParamsProp, onNavigate, headerComponent: HeaderComponent, jobListingComponent: JobListingComponent, className, }: JobsClientProps): import("react/jsx-runtime").JSX.Element;
|
|
27
31
|
export {};
|
|
28
32
|
//# sourceMappingURL=JobsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobsClient.d.ts","sourceRoot":"","sources":["../../src/components/JobsClient.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JobsClient.d.ts","sourceRoot":"","sources":["../../src/components/JobsClient.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,KAAK,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAOxE,MAAM,MAAM,eAAe,GAAG;IAC5B,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,uIAAuI;IACvI,YAAY,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,yIAAyI;IACzI,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,gCAAgC;IAChC,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;KACxC,CAAC,CAAC;IACH,qCAAqC;IACrC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACxC,OAAO,EAAE,gBAAgB,EAAE,CAAC;QAC5B,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,SAAS,EACT,YAAY,EAAE,gBAAgB,EAC9B,UAAU,EACV,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,mBAAmB,EACxC,SAAS,GACV,EAAE,eAAe,2CAyFjB"}
|
|
@@ -1,50 +1,58 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
+
function getDefaultSearchParams() {
|
|
5
|
+
if (typeof window === 'undefined')
|
|
6
|
+
return new URLSearchParams();
|
|
7
|
+
return new URLSearchParams(window.location.search);
|
|
8
|
+
}
|
|
9
|
+
export default function JobsClient({ initialVacancies, initialQuery, initialLocation, initialCategory, totalJobs, searchParams: searchParamsProp, onNavigate, headerComponent: HeaderComponent, jobListingComponent: JobListingComponent, className, }) {
|
|
10
|
+
const [urlParams, setUrlParams] = useState(getDefaultSearchParams);
|
|
11
|
+
const searchParams = searchParamsProp ?? urlParams;
|
|
8
12
|
const [_filter, setFilter] = useState({
|
|
9
13
|
keyword: initialQuery,
|
|
10
14
|
location: initialLocation,
|
|
11
15
|
category: initialCategory ? initialCategory.split(',') : [],
|
|
12
16
|
});
|
|
13
|
-
const handleSearch = (next) => {
|
|
17
|
+
const handleSearch = useCallback((next) => {
|
|
14
18
|
setFilter(next);
|
|
15
|
-
const url = new URL(window.location.href);
|
|
19
|
+
const url = new URL(typeof window !== 'undefined' ? window.location.href : 'http://localhost');
|
|
16
20
|
const kw = next.keyword.trim();
|
|
17
|
-
if (kw)
|
|
21
|
+
if (kw)
|
|
18
22
|
url.searchParams.set('query', kw);
|
|
19
|
-
|
|
20
|
-
else {
|
|
23
|
+
else
|
|
21
24
|
url.searchParams.delete('query');
|
|
22
|
-
}
|
|
23
25
|
const loc = next.location.trim();
|
|
24
|
-
if (loc)
|
|
26
|
+
if (loc)
|
|
25
27
|
url.searchParams.set('location', loc);
|
|
26
|
-
|
|
27
|
-
else {
|
|
28
|
+
else
|
|
28
29
|
url.searchParams.delete('location');
|
|
29
|
-
|
|
30
|
-
if (next.category.length > 0) {
|
|
30
|
+
if (next.category.length > 0)
|
|
31
31
|
url.searchParams.set('category', next.category.join(','));
|
|
32
|
-
|
|
33
|
-
else {
|
|
32
|
+
else
|
|
34
33
|
url.searchParams.delete('category');
|
|
34
|
+
const urlStr = url.toString();
|
|
35
|
+
if (onNavigate) {
|
|
36
|
+
onNavigate(urlStr);
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
else if (typeof window !== 'undefined') {
|
|
39
|
+
window.history.pushState({}, '', urlStr);
|
|
40
|
+
setUrlParams(new URLSearchParams(url.search));
|
|
41
|
+
}
|
|
42
|
+
}, [onNavigate]);
|
|
40
43
|
useEffect(() => {
|
|
41
44
|
setFilter({
|
|
42
45
|
keyword: searchParams?.get('query') || '',
|
|
43
46
|
location: searchParams?.get('location') || '',
|
|
44
|
-
category: searchParams?.get('category')
|
|
45
|
-
? searchParams.get('category').split(',')
|
|
46
|
-
: [],
|
|
47
|
+
category: searchParams?.get('category') ? searchParams.get('category').split(',') : [],
|
|
47
48
|
});
|
|
48
49
|
}, [searchParams]);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (searchParamsProp != null)
|
|
52
|
+
return;
|
|
53
|
+
const onPopState = () => setUrlParams(getDefaultSearchParams());
|
|
54
|
+
window.addEventListener('popstate', onPopState);
|
|
55
|
+
return () => window.removeEventListener('popstate', onPopState);
|
|
56
|
+
}, [searchParamsProp]);
|
|
49
57
|
return (_jsxs("div", { className: className, children: [HeaderComponent ? (_jsx(HeaderComponent, { jobCount: totalJobs, handleSearch: handleSearch })) : (_jsxs("div", { className: "p-4 border-b", children: [_jsxs("p", { className: "text-sm text-gray-600", children: [totalJobs, " job", totalJobs !== 1 ? 's' : '', " found"] }), _jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Provide a headerComponent prop to customize the header" })] })), _jsx("div", { className: "max-w-7xl px-6 mx-auto mt-12", children: JobListingComponent ? (_jsx(JobListingComponent, { joblist: initialVacancies, jobCount: totalJobs })) : (_jsx("div", { className: "space-y-4", children: initialVacancies.length === 0 ? (_jsx("p", { className: "text-center text-gray-500 py-8", children: "No jobs found" })) : (initialVacancies.map((job) => (_jsxs("div", { className: "p-4 border rounded-lg hover:shadow-md transition-shadow", children: [_jsx("h3", { className: "font-semibold text-lg", children: job.title }), _jsx("p", { className: "text-sm text-gray-600 mt-1", children: job.company_name }), _jsx("p", { className: "text-xs text-gray-500 mt-1", children: job.location }), _jsx("p", { className: "text-xs text-gray-500 mt-1", children: "Provide a jobListingComponent prop to customize the listing" })] }, job.id)))) })) })] }));
|
|
50
58
|
}
|
|
@@ -11,7 +11,7 @@ type Config = {
|
|
|
11
11
|
isIntern?: boolean;
|
|
12
12
|
/** Optional token for authenticated requests */
|
|
13
13
|
token?: string;
|
|
14
|
-
/** Optional search params - if not provided,
|
|
14
|
+
/** Optional search params - if not provided, uses window.location.search when in browser */
|
|
15
15
|
searchParams?: URLSearchParams | null;
|
|
16
16
|
};
|
|
17
17
|
type UnifiedPagination = {
|
|
@@ -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;
|
|
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,wEAAwE;IACxE,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"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import { apiRequest } from '../utils/api-request';
|
|
4
|
-
// Import useSearchParams from next/navigation
|
|
5
|
-
// Next.js is a peer dependency, so this should be available
|
|
6
|
-
// If not using Next.js, provide searchParams in the config
|
|
7
|
-
import { useSearchParams as useNextSearchParams } from 'next/navigation';
|
|
8
4
|
export const useGetAllVacancy = ({ publicFetch = true, mode = 'all', page, limit, companyId, forceStatus, isIntern = false, token, searchParams: providedSearchParams, } = {}) => {
|
|
9
5
|
const isReady = !!token || publicFetch;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const searchParams = providedSearchParams ??
|
|
7
|
+
(typeof window !== 'undefined'
|
|
8
|
+
? new URLSearchParams(window.location.search)
|
|
9
|
+
: new URLSearchParams());
|
|
14
10
|
const searchQuery = searchParams?.get('query') || '';
|
|
15
11
|
const urlLimit = Number(searchParams?.get('pageLimit') || '50');
|
|
16
12
|
const location = searchParams?.get('location') || '';
|
package/package.json
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@recruitnepal/shared-packages",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Shared UI components and hooks for Recruit Nepal projects",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"dev": "tsc --watch",
|
|
10
|
-
"prepublishOnly": "npm run build"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"react",
|
|
14
|
-
"nextjs",
|
|
15
|
-
"recruit-nepal",
|
|
16
|
-
"shared-components"
|
|
17
|
-
],
|
|
18
|
-
"author": "",
|
|
19
|
-
"license": "MIT",
|
|
20
|
-
"peerDependencies": {
|
|
21
|
-
"react": "^18.2.0",
|
|
22
|
-
"react-dom": "^18.2.0",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@types/
|
|
34
|
-
"@types/react": "^18.2.
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@recruitnepal/shared-packages",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Shared UI components and hooks for Recruit Nepal projects",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "tsc --watch",
|
|
10
|
+
"prepublishOnly": "npm run build"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"react",
|
|
14
|
+
"nextjs",
|
|
15
|
+
"recruit-nepal",
|
|
16
|
+
"shared-components"
|
|
17
|
+
],
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "^18.2.0",
|
|
22
|
+
"react-dom": "^18.2.0",
|
|
23
|
+
"@tanstack/react-query": "^5.50.0",
|
|
24
|
+
"zod": "^3.22.0",
|
|
25
|
+
"react-hook-form": "^7.49.0",
|
|
26
|
+
"@hookform/resolvers": "^3.3.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"axios": "^1.7.8"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.11.17",
|
|
33
|
+
"@types/react": "^18.2.55",
|
|
34
|
+
"@types/react-dom": "^18.2.19",
|
|
35
|
+
"typescript": "^5.3.3",
|
|
36
|
+
"zod": "^3.22.0",
|
|
37
|
+
"react-hook-form": "^7.49.0",
|
|
38
|
+
"@hookform/resolvers": "^3.3.0"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
43
|
+
]
|
|
44
|
+
}
|