@next-degree/pickle-shared-js 0.12.1 → 0.12.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 (85) hide show
  1. package/dist/{company_service_sanity-Br0R7m-A.d.cts → company_service_sanity-2J1ZuUnu.d.cts} +1 -1
  2. package/dist/{company_service_sanity-DF01qvTz.d.ts → company_service_sanity-KaAGfnNV.d.ts} +1 -1
  3. package/dist/components/jobCard/JobLocation.cjs +92 -12
  4. package/dist/components/jobCard/JobLocation.cjs.map +1 -1
  5. package/dist/components/jobCard/JobLocation.d.cts +7 -5
  6. package/dist/components/jobCard/JobLocation.d.ts +7 -5
  7. package/dist/components/jobCard/JobLocation.js +92 -12
  8. package/dist/components/jobCard/JobLocation.js.map +1 -1
  9. package/dist/components/jobPost/JobHeader.cjs +1 -0
  10. package/dist/components/jobPost/JobHeader.cjs.map +1 -1
  11. package/dist/components/jobPost/JobHeader.js +1 -0
  12. package/dist/components/jobPost/JobHeader.js.map +1 -1
  13. package/dist/components/jobPost/JobPost.cjs +9 -5
  14. package/dist/components/jobPost/JobPost.cjs.map +1 -1
  15. package/dist/components/jobPost/JobPost.d.cts +1 -1
  16. package/dist/components/jobPost/JobPost.d.ts +1 -1
  17. package/dist/components/jobPost/JobPost.js +9 -5
  18. package/dist/components/jobPost/JobPost.js.map +1 -1
  19. package/dist/components/primitives/command.d.cts +3 -3
  20. package/dist/components/primitives/command.d.ts +3 -3
  21. package/dist/components/primitives/input-otp.d.cts +2 -2
  22. package/dist/components/primitives/input-otp.d.ts +2 -2
  23. package/dist/components/ui/Button.d.cts +1 -1
  24. package/dist/components/ui/Button.d.ts +1 -1
  25. package/dist/components/ui/Chip.cjs +1 -0
  26. package/dist/components/ui/Chip.cjs.map +1 -1
  27. package/dist/components/ui/Chip.d.cts +1 -1
  28. package/dist/components/ui/Chip.d.ts +1 -1
  29. package/dist/components/ui/Chip.js +1 -0
  30. package/dist/components/ui/Chip.js.map +1 -1
  31. package/dist/components/ui/Select.cjs +1 -0
  32. package/dist/components/ui/Select.cjs.map +1 -1
  33. package/dist/components/ui/Select.js +1 -0
  34. package/dist/components/ui/Select.js.map +1 -1
  35. package/dist/components/ui/buttonShadcn.d.cts +1 -1
  36. package/dist/components/ui/buttonShadcn.d.ts +1 -1
  37. package/dist/{displayText-DzxDrQAT.d.cts → displayText-DW0qiJqh.d.cts} +2 -2
  38. package/dist/{displayText-C1DIK8hr.d.ts → displayText-DahwdHdi.d.ts} +2 -2
  39. package/dist/hooks/useDisplayText.d.cts +3 -3
  40. package/dist/hooks/useDisplayText.d.ts +3 -3
  41. package/dist/index.cjs +59 -15
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +5 -4
  44. package/dist/index.d.ts +5 -4
  45. package/dist/index.js +59 -15
  46. package/dist/index.js.map +1 -1
  47. package/dist/{job_posting_service_latest-DCbi2bXu.d.cts → job_posting_service_latest-DdgK8Nnz.d.cts} +29 -29
  48. package/dist/{job_posting_service_latest-DCbi2bXu.d.ts → job_posting_service_latest-DdgK8Nnz.d.ts} +29 -29
  49. package/dist/{job_posting_service_sanity-CfLaGMVK.d.ts → job_posting_service_sanity-BKo9TBDT.d.ts} +106 -106
  50. package/dist/{job_posting_service_sanity-B7GvIdYQ.d.cts → job_posting_service_sanity-BNq-Am9N.d.cts} +106 -106
  51. package/dist/lib/locations.cjs +32 -7
  52. package/dist/lib/locations.cjs.map +1 -1
  53. package/dist/lib/locations.d.cts +8 -5
  54. package/dist/lib/locations.d.ts +8 -5
  55. package/dist/lib/locations.js +30 -6
  56. package/dist/lib/locations.js.map +1 -1
  57. package/dist/lib/mappings.d.cts +3 -3
  58. package/dist/lib/mappings.d.ts +3 -3
  59. package/dist/lib/salaryRange.d.cts +1 -1
  60. package/dist/lib/salaryRange.d.ts +1 -1
  61. package/dist/services/displayText.d.cts +3 -3
  62. package/dist/services/displayText.d.ts +3 -3
  63. package/dist/styles/globals.css +0 -7
  64. package/dist/styles/globals.css.map +1 -1
  65. package/dist/types/data/job_posting_service_latest.d.cts +1 -1
  66. package/dist/types/data/job_posting_service_latest.d.ts +1 -1
  67. package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
  68. package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
  69. package/dist/types/index.d.cts +4 -4
  70. package/dist/types/index.d.ts +4 -4
  71. package/dist/types/latest/custom/company_service_sanity.d.cts +2 -2
  72. package/dist/types/latest/custom/company_service_sanity.d.ts +2 -2
  73. package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
  74. package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
  75. package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
  76. package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
  77. package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
  78. package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
  79. package/package.json +3 -2
  80. package/dist/{job_posting_service_latest-tqnHqjwc.d.cts → job_posting_service_latest-C_TEBzCf.d.cts} +28 -28
  81. package/dist/{job_posting_service_latest-tqnHqjwc.d.ts → job_posting_service_latest-C_TEBzCf.d.ts} +28 -28
  82. package/dist/{shared_pickle_output_latest-DKOmTyYk.d.cts → shared_pickle_output_latest-CXBCG04N.d.cts} +4 -4
  83. package/dist/{shared_pickle_output_latest-DKOmTyYk.d.ts → shared_pickle_output_latest-CXBCG04N.d.ts} +4 -4
  84. package/dist/{shared_pickle_output_latest--XZhOUyE.d.cts → shared_pickle_output_latest-CtvHTPeX.d.cts} +4 -4
  85. package/dist/{shared_pickle_output_latest--XZhOUyE.d.ts → shared_pickle_output_latest-CtvHTPeX.d.ts} +4 -4
package/dist/index.d.cts CHANGED
@@ -35,8 +35,8 @@ export { WindowHistoryProvider } from './contexts/WindowHistoryProvider.cjs';
35
35
  export { useDisplayText } from './hooks/useDisplayText.cjs';
36
36
  export { useWindowHistory } from './hooks/useWindowHistory.cjs';
37
37
  export { c as CompanyService } from './company_service_latest-CITz7F53.cjs';
38
- export { j as JobPostService } from './job_posting_service_latest-tqnHqjwc.cjs';
39
- export { s as SharedService } from './shared_pickle_output_latest-DKOmTyYk.cjs';
38
+ export { j as JobPostService } from './job_posting_service_latest-C_TEBzCf.cjs';
39
+ export { s as SharedService } from './shared_pickle_output_latest-CXBCG04N.cjs';
40
40
  import 'cva/types';
41
41
  import 'react/jsx-runtime';
42
42
  import 'cva';
@@ -49,8 +49,9 @@ import './components/primitives/radio-group.cjs';
49
49
  import '@radix-ui/react-radio-group';
50
50
  import 'next/link';
51
51
  import '@radix-ui/react-tabs';
52
- import './shared_pickle_output_latest--XZhOUyE.cjs';
52
+ import './shared_pickle_output_latest-CtvHTPeX.cjs';
53
53
  import 'zod';
54
54
  import 'clsx';
55
55
  import './lib/icons.cjs';
56
- import './displayText-DzxDrQAT.cjs';
56
+ import './job_posting_service_latest-DdgK8Nnz.cjs';
57
+ import './displayText-DW0qiJqh.cjs';
package/dist/index.d.ts CHANGED
@@ -35,8 +35,8 @@ export { WindowHistoryProvider } from './contexts/WindowHistoryProvider.js';
35
35
  export { useDisplayText } from './hooks/useDisplayText.js';
36
36
  export { useWindowHistory } from './hooks/useWindowHistory.js';
37
37
  export { c as CompanyService } from './company_service_latest-CITz7F53.js';
38
- export { j as JobPostService } from './job_posting_service_latest-tqnHqjwc.js';
39
- export { s as SharedService } from './shared_pickle_output_latest-DKOmTyYk.js';
38
+ export { j as JobPostService } from './job_posting_service_latest-C_TEBzCf.js';
39
+ export { s as SharedService } from './shared_pickle_output_latest-CXBCG04N.js';
40
40
  import 'cva/types';
41
41
  import 'react/jsx-runtime';
42
42
  import 'cva';
@@ -49,8 +49,9 @@ import './components/primitives/radio-group.js';
49
49
  import '@radix-ui/react-radio-group';
50
50
  import 'next/link';
51
51
  import '@radix-ui/react-tabs';
52
- import './shared_pickle_output_latest--XZhOUyE.js';
52
+ import './shared_pickle_output_latest-CtvHTPeX.js';
53
53
  import 'zod';
54
54
  import 'clsx';
55
55
  import './lib/icons.js';
56
- import './displayText-C1DIK8hr.js';
56
+ import './job_posting_service_latest-DdgK8Nnz.js';
57
+ import './displayText-DahwdHdi.js';
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var chipVariants = cva(["flex", "items-center", "rounded-3xl", "border", "w-fit"
15
15
  neutral: ["text-grey-80", "border-grey-10"],
16
16
  primary: ["text-purple-100", "border-purple-20"],
17
17
  danger: ["text-pumpkin-100", "border-pumpkin-20"],
18
+ jobLocation: ["text-grey-80", "border-grey-10", "bg-grey-5"],
18
19
  onboarding: ["text-green-100", "bg-green-10", "cursor-pointer"],
19
20
  onboardingSelected: ["text-white", "bg-green-90", "cursor-pointer"]
20
21
  },
@@ -3341,14 +3342,37 @@ var useDisplayText = (scope, value) => {
3341
3342
  };
3342
3343
 
3343
3344
  // src/lib/locations.ts
3344
- function formattedAddress(address) {
3345
+ function formattedAddress(address, isRemote = false) {
3346
+ if (!address) return null;
3345
3347
  const { addressLocality, addressRegion, addressCountry } = address;
3346
- if (addressLocality && addressRegion) return `${addressLocality}, ${addressRegion}`;
3347
- if (addressRegion && addressCountry) return `${addressRegion}, ${addressCountry}`;
3348
- if (addressRegion) return addressRegion;
3349
- if (addressCountry) return addressCountry;
3348
+ const remoteMessage = isRemote ? " | Remote" : "";
3349
+ if (addressLocality && addressRegion)
3350
+ return `${addressLocality}, ${addressRegion + remoteMessage}`;
3351
+ if (addressRegion && addressCountry) return `${addressRegion}, ${addressCountry + remoteMessage}`;
3352
+ if (addressRegion) return `${addressRegion + remoteMessage}`;
3353
+ if (addressCountry) return `${addressCountry + remoteMessage}`;
3350
3354
  return null;
3351
3355
  }
3356
+ function getAddressList(jobPost) {
3357
+ const locations = [];
3358
+ if (jobPost.jobLocation) {
3359
+ const address = formattedAddress(jobPost.jobLocation, jobPost.isRemote);
3360
+ if (address) locations.push(address);
3361
+ }
3362
+ if (jobPost.applicableOffices && jobPost.applicableOffices.length > 0) {
3363
+ jobPost.applicableOffices.map((office) => {
3364
+ const address = formattedAddress(office?.geoLocation?.address, jobPost.isRemote);
3365
+ if (address && !locations.includes(address)) locations.push(address);
3366
+ });
3367
+ }
3368
+ if (jobPost.applicantLocationRequirements && jobPost.applicantLocationRequirements.length > 0) {
3369
+ jobPost.applicantLocationRequirements.map((place) => {
3370
+ const address = formattedAddress(place?.address, jobPost.isRemote);
3371
+ if (address && !locations.includes(address)) locations.push(address);
3372
+ });
3373
+ }
3374
+ return locations;
3375
+ }
3352
3376
  function formattedJobLocation(job) {
3353
3377
  const address = job.jobLocation && formattedAddress(job.jobLocation);
3354
3378
  const remote = job.isRemote ? "Remote" : "";
@@ -3460,17 +3484,37 @@ function JobPost({
3460
3484
  // src/components/jobCard/JobLocation.tsx
3461
3485
  import { MapPin as MapPin2 } from "lucide-react";
3462
3486
  import { jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
3463
- function JobLocation({ mainLocation, extendedLocations }) {
3464
- return /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", "data-testid": "job-card-location", children: [
3487
+ function JobLocation({ jobPost }) {
3488
+ const locations = getAddressList(jobPost);
3489
+ if (!locations || locations.length === 0) return null;
3490
+ const primaryOffice = locations[0];
3491
+ const extendedLocations = locations.slice(1).map((address) => address);
3492
+ return /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", "data-testid": "job-location-element", children: [
3465
3493
  /* @__PURE__ */ jsx42(MapPin2, { size: 16 }),
3466
- /* @__PURE__ */ jsx42("span", { className: "text-sm font-thin", children: mainLocation }),
3467
- extendedLocations && /* @__PURE__ */ jsx42(TooltipProvider, { children: /* @__PURE__ */ jsxs27(Tooltip, { children: [
3468
- /* @__PURE__ */ jsx42(TooltipTrigger, { children: /* @__PURE__ */ jsxs27("div", { className: "length-text group text-nowrap rounded-full bg-grey-5 px-2 py-1 text-sm font-bold text-gray-700 group-hover:cursor-pointer", children: [
3469
- "+ ",
3470
- extendedLocations.length,
3471
- " more"
3472
- ] }) }),
3473
- /* @__PURE__ */ jsx42(TooltipContent, { className: "border-1 rounded-md border border-grey-5 bg-white p-2", children: extendedLocations.map((location) => /* @__PURE__ */ jsx42("div", { className: "text-nowrap text-sm", children: location }, location)) })
3494
+ /* @__PURE__ */ jsx42("span", { className: "text-sm font-thin", children: primaryOffice }),
3495
+ extendedLocations.length > 0 && /* @__PURE__ */ jsx42(TooltipProvider, { children: /* @__PURE__ */ jsxs27(Tooltip, { children: [
3496
+ /* @__PURE__ */ jsx42(TooltipTrigger, { children: /* @__PURE__ */ jsxs27(
3497
+ Chip_default,
3498
+ {
3499
+ className: "font-bold",
3500
+ size: "small",
3501
+ variant: "jobLocation",
3502
+ "data-testid": "job-location-tooltip",
3503
+ children: [
3504
+ "+ ",
3505
+ extendedLocations.length,
3506
+ " more"
3507
+ ]
3508
+ }
3509
+ ) }),
3510
+ /* @__PURE__ */ jsx42(
3511
+ TooltipContent,
3512
+ {
3513
+ className: "border-1 rounded-md border border-grey-5 bg-white p-2",
3514
+ "data-testid": "job-location-tooltip-content",
3515
+ children: extendedLocations.map((location) => /* @__PURE__ */ jsx42("div", { className: "text-nowrap text-sm", children: location }, location))
3516
+ }
3517
+ )
3474
3518
  ] }) })
3475
3519
  ] });
3476
3520
  }