@next-degree/pickle-shared-js 0.12.1 → 0.12.3

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 (91) 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/StepTabs.cjs +21 -4
  36. package/dist/components/ui/StepTabs.cjs.map +1 -1
  37. package/dist/components/ui/StepTabs.d.cts +2 -2
  38. package/dist/components/ui/StepTabs.d.ts +2 -2
  39. package/dist/components/ui/StepTabs.js +21 -4
  40. package/dist/components/ui/StepTabs.js.map +1 -1
  41. package/dist/components/ui/buttonShadcn.d.cts +1 -1
  42. package/dist/components/ui/buttonShadcn.d.ts +1 -1
  43. package/dist/{displayText-DzxDrQAT.d.cts → displayText-DW0qiJqh.d.cts} +2 -2
  44. package/dist/{displayText-C1DIK8hr.d.ts → displayText-DahwdHdi.d.ts} +2 -2
  45. package/dist/hooks/useDisplayText.d.cts +3 -3
  46. package/dist/hooks/useDisplayText.d.ts +3 -3
  47. package/dist/index.cjs +80 -19
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.d.cts +5 -4
  50. package/dist/index.d.ts +5 -4
  51. package/dist/index.js +80 -19
  52. package/dist/index.js.map +1 -1
  53. package/dist/{job_posting_service_latest-DCbi2bXu.d.cts → job_posting_service_latest-DdgK8Nnz.d.cts} +29 -29
  54. package/dist/{job_posting_service_latest-DCbi2bXu.d.ts → job_posting_service_latest-DdgK8Nnz.d.ts} +29 -29
  55. package/dist/{job_posting_service_sanity-CfLaGMVK.d.ts → job_posting_service_sanity-BKo9TBDT.d.ts} +106 -106
  56. package/dist/{job_posting_service_sanity-B7GvIdYQ.d.cts → job_posting_service_sanity-BNq-Am9N.d.cts} +106 -106
  57. package/dist/lib/locations.cjs +32 -7
  58. package/dist/lib/locations.cjs.map +1 -1
  59. package/dist/lib/locations.d.cts +8 -5
  60. package/dist/lib/locations.d.ts +8 -5
  61. package/dist/lib/locations.js +30 -6
  62. package/dist/lib/locations.js.map +1 -1
  63. package/dist/lib/mappings.d.cts +3 -3
  64. package/dist/lib/mappings.d.ts +3 -3
  65. package/dist/lib/salaryRange.d.cts +1 -1
  66. package/dist/lib/salaryRange.d.ts +1 -1
  67. package/dist/services/displayText.d.cts +3 -3
  68. package/dist/services/displayText.d.ts +3 -3
  69. package/dist/styles/globals.css +23 -7
  70. package/dist/styles/globals.css.map +1 -1
  71. package/dist/types/data/job_posting_service_latest.d.cts +1 -1
  72. package/dist/types/data/job_posting_service_latest.d.ts +1 -1
  73. package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
  74. package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
  75. package/dist/types/index.d.cts +4 -4
  76. package/dist/types/index.d.ts +4 -4
  77. package/dist/types/latest/custom/company_service_sanity.d.cts +2 -2
  78. package/dist/types/latest/custom/company_service_sanity.d.ts +2 -2
  79. package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
  80. package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
  81. package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
  82. package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
  83. package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
  84. package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
  85. package/package.json +3 -2
  86. package/dist/{job_posting_service_latest-tqnHqjwc.d.cts → job_posting_service_latest-C_TEBzCf.d.cts} +28 -28
  87. package/dist/{job_posting_service_latest-tqnHqjwc.d.ts → job_posting_service_latest-C_TEBzCf.d.ts} +28 -28
  88. package/dist/{shared_pickle_output_latest-DKOmTyYk.d.cts → shared_pickle_output_latest-CXBCG04N.d.cts} +4 -4
  89. package/dist/{shared_pickle_output_latest-DKOmTyYk.d.ts → shared_pickle_output_latest-CXBCG04N.d.ts} +4 -4
  90. package/dist/{shared_pickle_output_latest--XZhOUyE.d.cts → shared_pickle_output_latest-CtvHTPeX.d.cts} +4 -4
  91. 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
  },
@@ -1977,7 +1978,20 @@ var tabParentVariants = cva11("flex flex-col", {
1977
1978
  variants: {
1978
1979
  variant: {
1979
1980
  primary: "rounded-lg border shadow-sm",
1980
- neutral: ""
1981
+ neutral: "",
1982
+ minimal: "relative overflow-x-auto"
1983
+ }
1984
+ },
1985
+ defaultVariants: {
1986
+ variant: "primary"
1987
+ }
1988
+ });
1989
+ var headerVariants = cva11("flex shrink-0 border-b border-grey-20", {
1990
+ variants: {
1991
+ variant: {
1992
+ primary: "",
1993
+ neutral: "",
1994
+ minimal: "w-fit relative border-none"
1981
1995
  }
1982
1996
  },
1983
1997
  defaultVariants: {
@@ -1990,7 +2004,8 @@ var singleTabVariants = cva11(
1990
2004
  variants: {
1991
2005
  variant: {
1992
2006
  primary: "first:rounded-tl-md last:rounded-tr-md hover:text-purple-100 data-[state=active]:text-purple-100 data-[state=active]:shadow-[inset_0_-1px_0_0,0_1px_0_0] data-[state=active]:shadow-current data-[state=active]:focus:relative data-[state=active]:focus:shadow-[0_0_0_2px] data-[state=active]:focus:shadow-black",
1993
- neutral: "first:rounded-tl-md last:rounded-tr-md hover:text-black data-[state=active]:text-black data-[state=active]:shadow-[inset_0_-1px_0_0,0_1px_0_0] data-[state=active]:shadow-current data-[state=active]:focus:relative"
2007
+ neutral: "first:rounded-tl-md last:rounded-tr-md hover:text-black data-[state=active]:text-black data-[state=active]:shadow-[inset_0_-1px_0_0,0_1px_0_0] data-[state=active]:shadow-current data-[state=active]:focus:relative",
2008
+ minimal: "whitespace-nowrap flex-none first:rounded-tl-md last:rounded-tr-md hover:text-black data-[state=active]:font-bold data-[state=active]:text-black data-[state=active]:shadow-[inset_0_-2px_0_0] data-[state=active]:shadow-current data-[state=active]:focus:relative"
1994
2009
  }
1995
2010
  },
1996
2011
  defaultVariants: {
@@ -2018,7 +2033,7 @@ function StepTabs({
2018
2033
  className: cn(tabParentVariants({ variant }), className),
2019
2034
  ...props,
2020
2035
  children: [
2021
- /* @__PURE__ */ jsx32(Tabs.List, { className: "flex shrink-0 border-b border-grey-20", children: list.length > 1 && list.map((item, index) => /* @__PURE__ */ jsx32(
2036
+ /* @__PURE__ */ jsx32(Tabs.List, { className: cn(headerVariants({ variant })), children: list.length > 1 && list.map((item, index) => /* @__PURE__ */ jsx32(
2022
2037
  Tabs.Trigger,
2023
2038
  {
2024
2039
  className: cn(singleTabVariants({ variant }), classNameTab),
@@ -2030,7 +2045,10 @@ function StepTabs({
2030
2045
  children && children.map((child, index) => /* @__PURE__ */ jsx32(
2031
2046
  Tabs.Content,
2032
2047
  {
2033
- className: "grow rounded-b-md bg-white p-5 outline-none",
2048
+ className: cn(
2049
+ "grow rounded-b-md bg-white p-5 outline-none",
2050
+ variant === "minimal" && "border-t"
2051
+ ),
2034
2052
  value: index.toString(),
2035
2053
  children: child
2036
2054
  },
@@ -3341,14 +3359,37 @@ var useDisplayText = (scope, value) => {
3341
3359
  };
3342
3360
 
3343
3361
  // src/lib/locations.ts
3344
- function formattedAddress(address) {
3362
+ function formattedAddress(address, isRemote = false) {
3363
+ if (!address) return null;
3345
3364
  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;
3365
+ const remoteMessage = isRemote ? " | Remote" : "";
3366
+ if (addressLocality && addressRegion)
3367
+ return `${addressLocality}, ${addressRegion + remoteMessage}`;
3368
+ if (addressRegion && addressCountry) return `${addressRegion}, ${addressCountry + remoteMessage}`;
3369
+ if (addressRegion) return `${addressRegion + remoteMessage}`;
3370
+ if (addressCountry) return `${addressCountry + remoteMessage}`;
3350
3371
  return null;
3351
3372
  }
3373
+ function getAddressList(jobPost) {
3374
+ const locations = [];
3375
+ if (jobPost.jobLocation) {
3376
+ const address = formattedAddress(jobPost.jobLocation, jobPost.isRemote);
3377
+ if (address) locations.push(address);
3378
+ }
3379
+ if (jobPost.applicableOffices && jobPost.applicableOffices.length > 0) {
3380
+ jobPost.applicableOffices.map((office) => {
3381
+ const address = formattedAddress(office?.geoLocation?.address, jobPost.isRemote);
3382
+ if (address && !locations.includes(address)) locations.push(address);
3383
+ });
3384
+ }
3385
+ if (jobPost.applicantLocationRequirements && jobPost.applicantLocationRequirements.length > 0) {
3386
+ jobPost.applicantLocationRequirements.map((place) => {
3387
+ const address = formattedAddress(place?.address, jobPost.isRemote);
3388
+ if (address && !locations.includes(address)) locations.push(address);
3389
+ });
3390
+ }
3391
+ return locations;
3392
+ }
3352
3393
  function formattedJobLocation(job) {
3353
3394
  const address = job.jobLocation && formattedAddress(job.jobLocation);
3354
3395
  const remote = job.isRemote ? "Remote" : "";
@@ -3460,17 +3501,37 @@ function JobPost({
3460
3501
  // src/components/jobCard/JobLocation.tsx
3461
3502
  import { MapPin as MapPin2 } from "lucide-react";
3462
3503
  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: [
3504
+ function JobLocation({ jobPost }) {
3505
+ const locations = getAddressList(jobPost);
3506
+ if (!locations || locations.length === 0) return null;
3507
+ const primaryOffice = locations[0];
3508
+ const extendedLocations = locations.slice(1).map((address) => address);
3509
+ return /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", "data-testid": "job-location-element", children: [
3465
3510
  /* @__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)) })
3511
+ /* @__PURE__ */ jsx42("span", { className: "text-sm font-thin", children: primaryOffice }),
3512
+ extendedLocations.length > 0 && /* @__PURE__ */ jsx42(TooltipProvider, { children: /* @__PURE__ */ jsxs27(Tooltip, { children: [
3513
+ /* @__PURE__ */ jsx42(TooltipTrigger, { children: /* @__PURE__ */ jsxs27(
3514
+ Chip_default,
3515
+ {
3516
+ className: "font-bold",
3517
+ size: "small",
3518
+ variant: "jobLocation",
3519
+ "data-testid": "job-location-tooltip",
3520
+ children: [
3521
+ "+ ",
3522
+ extendedLocations.length,
3523
+ " more"
3524
+ ]
3525
+ }
3526
+ ) }),
3527
+ /* @__PURE__ */ jsx42(
3528
+ TooltipContent,
3529
+ {
3530
+ className: "border-1 rounded-md border border-grey-5 bg-white p-2",
3531
+ "data-testid": "job-location-tooltip-content",
3532
+ children: extendedLocations.map((location) => /* @__PURE__ */ jsx42("div", { className: "text-nowrap text-sm", children: location }, location))
3533
+ }
3534
+ )
3474
3535
  ] }) })
3475
3536
  ] });
3476
3537
  }