@next-degree/pickle-shared-js 0.11.0 → 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 (111) hide show
  1. package/dist/{company_service_sanity-CGNCrk8e.d.cts → company_service_sanity-2J1ZuUnu.d.cts} +384 -384
  2. package/dist/{company_service_sanity-CAyYirw5.d.ts → company_service_sanity-KaAGfnNV.d.ts} +384 -384
  3. package/dist/components/jobCard/JobLocation.cjs +97 -14
  4. package/dist/components/jobCard/JobLocation.cjs.map +1 -1
  5. package/dist/components/jobCard/JobLocation.d.cts +8 -6
  6. package/dist/components/jobCard/JobLocation.d.ts +8 -6
  7. package/dist/components/jobCard/JobLocation.js +93 -14
  8. package/dist/components/jobCard/JobLocation.js.map +1 -1
  9. package/dist/components/jobPost/JobDescription.cjs +3 -1
  10. package/dist/components/jobPost/JobDescription.cjs.map +1 -1
  11. package/dist/components/jobPost/JobDescription.js +3 -1
  12. package/dist/components/jobPost/JobDescription.js.map +1 -1
  13. package/dist/components/jobPost/JobHeader.cjs +1 -0
  14. package/dist/components/jobPost/JobHeader.cjs.map +1 -1
  15. package/dist/components/jobPost/JobHeader.js +1 -0
  16. package/dist/components/jobPost/JobHeader.js.map +1 -1
  17. package/dist/components/jobPost/JobPost.cjs +26 -18
  18. package/dist/components/jobPost/JobPost.cjs.map +1 -1
  19. package/dist/components/jobPost/JobPost.d.cts +1 -1
  20. package/dist/components/jobPost/JobPost.d.ts +1 -1
  21. package/dist/components/jobPost/JobPost.js +26 -18
  22. package/dist/components/jobPost/JobPost.js.map +1 -1
  23. package/dist/components/primitives/command.d.cts +3 -3
  24. package/dist/components/primitives/command.d.ts +3 -3
  25. package/dist/components/primitives/input-otp.d.cts +2 -2
  26. package/dist/components/primitives/input-otp.d.ts +2 -2
  27. package/dist/components/ui/Chip.cjs +1 -0
  28. package/dist/components/ui/Chip.cjs.map +1 -1
  29. package/dist/components/ui/Chip.d.cts +1 -1
  30. package/dist/components/ui/Chip.d.ts +1 -1
  31. package/dist/components/ui/Chip.js +1 -0
  32. package/dist/components/ui/Chip.js.map +1 -1
  33. package/dist/components/ui/Combobox.cjs +28 -19
  34. package/dist/components/ui/Combobox.cjs.map +1 -1
  35. package/dist/components/ui/Combobox.js +29 -20
  36. package/dist/components/ui/Combobox.js.map +1 -1
  37. package/dist/components/ui/DismissibleBanner.cjs +85 -0
  38. package/dist/components/ui/DismissibleBanner.cjs.map +1 -0
  39. package/dist/components/ui/DismissibleBanner.d.cts +11 -0
  40. package/dist/components/ui/DismissibleBanner.d.ts +11 -0
  41. package/dist/components/ui/DismissibleBanner.js +60 -0
  42. package/dist/components/ui/DismissibleBanner.js.map +1 -0
  43. package/dist/components/ui/ReadMore.cjs +3 -1
  44. package/dist/components/ui/ReadMore.cjs.map +1 -1
  45. package/dist/components/ui/ReadMore.js +3 -1
  46. package/dist/components/ui/ReadMore.js.map +1 -1
  47. package/dist/components/ui/Select.cjs +1 -0
  48. package/dist/components/ui/Select.cjs.map +1 -1
  49. package/dist/components/ui/Select.js +1 -0
  50. package/dist/components/ui/Select.js.map +1 -1
  51. package/dist/{displayText-DHKm6_JF.d.cts → displayText-DW0qiJqh.d.cts} +2 -2
  52. package/dist/{displayText-D8MYOaYK.d.ts → displayText-DahwdHdi.d.ts} +2 -2
  53. package/dist/hooks/useDisplayText.d.cts +3 -3
  54. package/dist/hooks/useDisplayText.d.ts +3 -3
  55. package/dist/index.cjs +1260 -1131
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.cts +10 -5
  58. package/dist/index.d.ts +10 -5
  59. package/dist/index.js +1198 -1072
  60. package/dist/index.js.map +1 -1
  61. package/dist/{job_posting_service_latest-DaKYQh30.d.cts → job_posting_service_latest-C_TEBzCf.d.cts} +289 -289
  62. package/dist/{job_posting_service_latest-DaKYQh30.d.ts → job_posting_service_latest-C_TEBzCf.d.ts} +289 -289
  63. package/dist/{job_posting_service_latest-C8PT9mxn.d.cts → job_posting_service_latest-DdgK8Nnz.d.cts} +290 -290
  64. package/dist/{job_posting_service_latest-C8PT9mxn.d.ts → job_posting_service_latest-DdgK8Nnz.d.ts} +290 -290
  65. package/dist/{job_posting_service_sanity-nyUCPROx.d.ts → job_posting_service_sanity-BKo9TBDT.d.ts} +630 -630
  66. package/dist/{job_posting_service_sanity-BK7jdr2W.d.cts → job_posting_service_sanity-BNq-Am9N.d.cts} +630 -630
  67. package/dist/lib/locations.cjs +32 -7
  68. package/dist/lib/locations.cjs.map +1 -1
  69. package/dist/lib/locations.d.cts +8 -5
  70. package/dist/lib/locations.d.ts +8 -5
  71. package/dist/lib/locations.js +30 -6
  72. package/dist/lib/locations.js.map +1 -1
  73. package/dist/lib/mappings.d.cts +3 -3
  74. package/dist/lib/mappings.d.ts +3 -3
  75. package/dist/lib/salaryRange.cjs +14 -12
  76. package/dist/lib/salaryRange.cjs.map +1 -1
  77. package/dist/lib/salaryRange.d.cts +2 -2
  78. package/dist/lib/salaryRange.d.ts +2 -2
  79. package/dist/lib/salaryRange.js +14 -12
  80. package/dist/lib/salaryRange.js.map +1 -1
  81. package/dist/services/displayText.d.cts +3 -3
  82. package/dist/services/displayText.d.ts +3 -3
  83. package/dist/styles/globals.css +3 -7
  84. package/dist/styles/globals.css.map +1 -1
  85. package/dist/types/data/company_service_latest.d.cts +1 -1
  86. package/dist/types/data/company_service_latest.d.ts +1 -1
  87. package/dist/types/data/job_posting_service_latest.d.cts +1 -1
  88. package/dist/types/data/job_posting_service_latest.d.ts +1 -1
  89. package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
  90. package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
  91. package/dist/types/index.d.cts +5 -5
  92. package/dist/types/index.d.ts +5 -5
  93. package/dist/types/latest/company_service_latest.d.cts +1 -1
  94. package/dist/types/latest/company_service_latest.d.ts +1 -1
  95. package/dist/types/latest/custom/company_service_sanity.d.cts +3 -3
  96. package/dist/types/latest/custom/company_service_sanity.d.ts +3 -3
  97. package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
  98. package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
  99. package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
  100. package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
  101. package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
  102. package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
  103. package/package.json +4 -3
  104. package/dist/{company_service_latest-o6X0atwz.d.cts → company_service_latest-C7Moeufo.d.cts} +228 -228
  105. package/dist/{company_service_latest-o6X0atwz.d.ts → company_service_latest-C7Moeufo.d.ts} +228 -228
  106. package/dist/{company_service_latest-DpBsftTD.d.cts → company_service_latest-CITz7F53.d.cts} +228 -228
  107. package/dist/{company_service_latest-DpBsftTD.d.ts → company_service_latest-CITz7F53.d.ts} +228 -228
  108. package/dist/{shared_pickle_output_latest-BjRRmT8R.d.cts → shared_pickle_output_latest-CXBCG04N.d.cts} +15 -15
  109. package/dist/{shared_pickle_output_latest-BjRRmT8R.d.ts → shared_pickle_output_latest-CXBCG04N.d.ts} +15 -15
  110. package/dist/{shared_pickle_output_latest-BVF7Zh2H.d.cts → shared_pickle_output_latest-CtvHTPeX.d.cts} +15 -15
  111. package/dist/{shared_pickle_output_latest-BVF7Zh2H.d.ts → shared_pickle_output_latest-CtvHTPeX.d.ts} +15 -15
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { J as JobPostModel } from '../../job_posting_service_latest-DaKYQh30.cjs';
3
+ import { J as JobPostModel } from '../../job_posting_service_latest-C_TEBzCf.cjs';
4
4
  import 'zod';
5
5
 
6
6
  type JobPostProps = {
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { J as JobPostModel } from '../../job_posting_service_latest-DaKYQh30.js';
3
+ import { J as JobPostModel } from '../../job_posting_service_latest-C_TEBzCf.js';
4
4
  import 'zod';
5
5
 
6
6
  type JobPostProps = {
@@ -310,6 +310,7 @@ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
310
310
  function ReadMore({ text, ...props }) {
311
311
  const [isExpanded, setIsExpanded] = useState(false);
312
312
  const [maxWords, setMaxWords] = useState(160);
313
+ const isOverMaxWords = text.split(" ").length > maxWords;
313
314
  useEffect(() => {
314
315
  const updateMaxWords = () => {
315
316
  const windowWidth = window.innerWidth;
@@ -324,6 +325,7 @@ function ReadMore({ text, ...props }) {
324
325
  return () => window.removeEventListener("resize", updateMaxWords);
325
326
  }, []);
326
327
  function createReadMoreText(text2, maxWords2, isExpanded2) {
328
+ if (!isOverMaxWords) return text2;
327
329
  const words = text2.split(" ");
328
330
  const snippet2 = isExpanded2 ? text2 : words.slice(0, maxWords2).join(" ");
329
331
  const readMoreText = isExpanded2 ? "" : "...";
@@ -333,7 +335,7 @@ function ReadMore({ text, ...props }) {
333
335
  const snippet = createReadMoreText(text, maxWords, isExpanded);
334
336
  return /* @__PURE__ */ jsxs5("div", { ...props, children: [
335
337
  /* @__PURE__ */ jsx8("div", { "data-testid": "read-more-text", className: "prose lg:prose-lg", children: /* @__PURE__ */ jsx8(Markdown, { children: snippet }) }),
336
- /* @__PURE__ */ jsx8(
338
+ isOverMaxWords && /* @__PURE__ */ jsx8(
337
339
  Button,
338
340
  {
339
341
  type: "button",
@@ -498,6 +500,7 @@ var chipVariants = cva4(["flex", "items-center", "rounded-3xl", "border", "w-fit
498
500
  neutral: ["text-grey-80", "border-grey-10"],
499
501
  primary: ["text-purple-100", "border-purple-20"],
500
502
  danger: ["text-pumpkin-100", "border-pumpkin-20"],
503
+ jobLocation: ["text-grey-80", "border-grey-10", "bg-grey-5"],
501
504
  onboarding: ["text-green-100", "bg-green-10", "cursor-pointer"],
502
505
  onboardingSelected: ["text-white", "bg-green-90", "cursor-pointer"]
503
506
  },
@@ -1178,12 +1181,15 @@ var useDisplayText = (scope, value) => {
1178
1181
  };
1179
1182
 
1180
1183
  // src/lib/locations.ts
1181
- function formattedAddress(address) {
1184
+ function formattedAddress(address, isRemote = false) {
1185
+ if (!address) return null;
1182
1186
  const { addressLocality, addressRegion, addressCountry } = address;
1183
- if (addressLocality && addressRegion) return `${addressLocality}, ${addressRegion}`;
1184
- if (addressRegion && addressCountry) return `${addressRegion}, ${addressCountry}`;
1185
- if (addressRegion) return addressRegion;
1186
- if (addressCountry) return addressCountry;
1187
+ const remoteMessage = isRemote ? " | Remote" : "";
1188
+ if (addressLocality && addressRegion)
1189
+ return `${addressLocality}, ${addressRegion + remoteMessage}`;
1190
+ if (addressRegion && addressCountry) return `${addressRegion}, ${addressCountry + remoteMessage}`;
1191
+ if (addressRegion) return `${addressRegion + remoteMessage}`;
1192
+ if (addressCountry) return `${addressCountry + remoteMessage}`;
1187
1193
  return null;
1188
1194
  }
1189
1195
  function formattedJobLocation(job) {
@@ -1586,7 +1592,7 @@ var jobPostSchema2 = jobPostSchema.extend({
1586
1592
 
1587
1593
  // src/lib/salaryRange.ts
1588
1594
  var CurrencyEnum2 = shared_pickle_output_latest_exports.CurrencyEnum;
1589
- function salaryRange(salary) {
1595
+ function salaryRange(salary, showUnitText = true) {
1590
1596
  if (!salary) return null;
1591
1597
  let min = salary.minValue;
1592
1598
  let max = salary.maxValue;
@@ -1605,17 +1611,19 @@ function salaryRange(salary) {
1605
1611
  single = value.value;
1606
1612
  unitText = value.unitText;
1607
1613
  }
1608
- if (unitText === "YEAR") unitText = "per year";
1609
- if (unitText === "MONTH") unitText = "per month";
1610
- if (unitText === "WEEK") unitText = "per week";
1611
- if (unitText === "DAY") unitText = "per day";
1612
- if (unitText === "PER_ACTIVITY") unitText = "per activity";
1613
- if (unitText === "HOUR") unitText = "per hour";
1614
- if (min == null && max == null && single == null) return null;
1615
- if (single != null) return sign + single.toLocaleString() + " " + unitText;
1616
- if (min === max) return sign + min?.toLocaleString() + " " + unitText;
1617
- if (min != null && max != null)
1618
- return sign + min?.toLocaleString() + " - " + sign + max?.toLocaleString() + " " + unitText;
1614
+ if (unitText === "YEAR") unitText = " per year";
1615
+ if (unitText === "MONTH") unitText = " per month";
1616
+ if (unitText === "WEEK") unitText = " per week";
1617
+ if (unitText === "DAY") unitText = " per day";
1618
+ if (unitText === "PER_ACTIVITY") unitText = " per activity";
1619
+ if (unitText === "HOUR") unitText = " per hour";
1620
+ if (showUnitText === false) unitText = "";
1621
+ const isValid = (v) => v != null && v >= 0;
1622
+ if (!isValid(min) && !isValid(max) && !isValid(single)) return null;
1623
+ if (isValid(single)) return sign + single.toLocaleString() + unitText;
1624
+ if (min === max) return sign + min?.toLocaleString() + unitText;
1625
+ if (isValid(min) && isValid(max))
1626
+ return sign + min?.toLocaleString() + " - " + sign + max?.toLocaleString() + unitText;
1619
1627
  return null;
1620
1628
  }
1621
1629